From 7b374a46b9cee584123c29968ae5cf38d083eee1 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:08:45 +0100 Subject: [PATCH 01/14] Init gce --- conf/nginx.conf | 46 ---------------------------------------------- docker-compose.yml | 14 ++++---------- 2 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 conf/nginx.conf diff --git a/conf/nginx.conf b/conf/nginx.conf deleted file mode 100644 index a1eda675..00000000 --- a/conf/nginx.conf +++ /dev/null @@ -1,46 +0,0 @@ -user nginx; -worker_processes 1; - -events { - worker_connections 512; -} -http { - include mime.types; - server_tokens off; - - gzip on; - gzip_proxied any; - gzip_http_version 1.1; - gzip_comp_level 6; - gzip_types text/plain text/css text/javascript application/json application/x-javascript text/xml application/xml application/xml+rss; - gzip_disable msie6; - - upstream meeds-app { - server meeds:8080; - } - - server { - listen 80 default_server; - #server_name my.server.name; - - # Pass the client informations the the backend - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - client_max_body_size 0; - - # Websocket for Cometd - location /cometd/cometd { - proxy_pass http://meeds-app; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - - - location / { - proxy_pass http://meeds-app; - } - } -} diff --git a/docker-compose.yml b/docker-compose.yml index 498f4707..c50fa1b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,16 +16,6 @@ # version: '2' services: - web: - image: nginx:1.23-alpine - expose: - - "80" - ports: - - "80:80" - volumes: - - ./conf/nginx.conf:/etc/nginx/nginx.conf:ro - links: - - meeds meeds: image: ghcr.io/meeds-io/meeds/meeds-io:develop environment: @@ -43,6 +33,10 @@ services: volumes: - meeds_data:/srv/meeds - meeds_logs:/var/log/meeds + expose: + - "8080" + ports: + - "8080:8080" es: image: exoplatform/elasticsearch:2.0.3 volumes: From 30fd8dc38274eda84d8d06e5f560644c672b9e23 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:21:10 +0100 Subject: [PATCH 02/14] Add basic gce Readme --- gce.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gce.md diff --git a/gce.md b/gce.md new file mode 100644 index 00000000..0f62eed6 --- /dev/null +++ b/gce.md @@ -0,0 +1,13 @@ +# How to run ? +## VM Setup +Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions. See [doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html). +``` +sudo sysctl -w vm.max_map_count=262144 +``` +## Start Meeds +``` +docker-compose up -d +docker-compose logs -f meeds +``` +## Preview Port 8080 +After Meeds startup. Click on `Web preview` Button and click on Preview on Port 8080. Enjoy! From 686ed0c0cefa629776e8b7b4a5d39bead3123f8c Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:29:21 +0100 Subject: [PATCH 03/14] Add more docs --- gce.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gce.md b/gce.md index 0f62eed6..5f5a927f 100644 --- a/gce.md +++ b/gce.md @@ -10,4 +10,21 @@ docker-compose up -d docker-compose logs -f meeds ``` ## Preview Port 8080 -After Meeds startup. Click on `Web preview` Button and click on Preview on Port 8080. Enjoy! +After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! + +## Stop Meeds + - To stop Meeds without removing docker containers: + ``` + docker-compose stop + ``` + - To stop Meeds with removing docker containers: + ``` + docker-compose down + ``` + - To stop Meeds with removing docker containers and volumes: + ``` + docker-compose down -v + ``` +You can start again meeds by following the previous step. + +That's all :) \ No newline at end of file From dc7d2892ce07b1f0d0de0b15b313aa47e385ac8e Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:32:37 +0100 Subject: [PATCH 04/14] Add Readme button --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9561b06c..f5bcb124 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Meeds Docker image +[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FMeeds-io%2Fmeeds-docker&cloudshell_git_branch=gce&cloudshell_tutorial=gce.md) + The image is compatible with the following databases system : `MySQL` (default) / `HSQLDB` / `PostgreSQL` ![Docker Stars](https://img.shields.io/docker/stars/meedsio/meeds.svg) - ![Docker Pulls](https://img.shields.io/docker/pulls/meedsio/meeds.svg) From e13d4de54c62cac98c7e48798974b8e19b94ef39 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:33:51 +0100 Subject: [PATCH 05/14] Add start paragraph --- gce.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gce.md b/gce.md index 5f5a927f..49753e36 100644 --- a/gce.md +++ b/gce.md @@ -1,4 +1,7 @@ # How to run ? + +Weclome to Meeds-io Startup tutorial. Here we will show you how to run Meeds in few steps. To get started, click on Start! + ## VM Setup Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions. See [doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html). ``` From e8dfec3ba3fca488c461e3cb4db983cf6ade0676 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 14:35:01 +0100 Subject: [PATCH 06/14] Add start paragraph --- gce.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gce.md b/gce.md index 49753e36..68dfdfff 100644 --- a/gce.md +++ b/gce.md @@ -1,5 +1,7 @@ # How to run ? +## Getting started + Weclome to Meeds-io Startup tutorial. Here we will show you how to run Meeds in few steps. To get started, click on Start! ## VM Setup From 59ced24cb57ff3b51c71c8f520f22cfd5ab0e824 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 15:10:26 +0100 Subject: [PATCH 07/14] Add bash notation + more docs --- gce.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gce.md b/gce.md index 68dfdfff..60290028 100644 --- a/gce.md +++ b/gce.md @@ -6,30 +6,37 @@ Weclome to Meeds-io Startup tutorial. Here we will show you how to run Meeds in ## VM Setup Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions. See [doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html). -``` +```bash sudo sysctl -w vm.max_map_count=262144 ``` ## Start Meeds -``` +```bash docker-compose up -d docker-compose logs -f meeds ``` -## Preview Port 8080 + +Wait for Meeds startup. A log message should appear: +``` +| INFO | Server startup in [XXXXX] milliseconds [org.apache.catalina.startup.Catalina
] +``` After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! ## Stop Meeds +Hope you enjoyed Meeds. You can tear down the server by following one of these options: - To stop Meeds without removing docker containers: - ``` + ```bash docker-compose stop ``` - To stop Meeds with removing docker containers: - ``` + ```bash docker-compose down ``` - To stop Meeds with removing docker containers and volumes: - ``` + ```bash docker-compose down -v ``` You can start again meeds by following the previous step. +You can checkout our Github [organisation](https://github.com/Meeds-io) and our [builders hub](https://builders.meeds.io). + That's all :) \ No newline at end of file From d23a02134d268767886aa4743334151605c24c2b Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 15:19:13 +0100 Subject: [PATCH 08/14] Adjust format --- gce.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gce.md b/gce.md index 60290028..f134d487 100644 --- a/gce.md +++ b/gce.md @@ -19,7 +19,7 @@ Wait for Meeds startup. A log message should appear: ``` | INFO | Server startup in [XXXXX] milliseconds [org.apache.catalina.startup.Catalina
] ``` -After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! +After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! ## Stop Meeds Hope you enjoyed Meeds. You can tear down the server by following one of these options: From 627332e41c8f408410476ed4eba4f63714bcc25d Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 15:35:06 +0100 Subject: [PATCH 09/14] Add walkthrough-web-preview-icon icon --- gce.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gce.md b/gce.md index f134d487..c2218c65 100644 --- a/gce.md +++ b/gce.md @@ -19,7 +19,7 @@ Wait for Meeds startup. A log message should appear: ``` | INFO | Server startup in [XXXXX] milliseconds [org.apache.catalina.startup.Catalina
] ``` -After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! +After Meeds startup. Click on `Web preview` Button and click on `Preview on Port 8080`. Enjoy! ## Stop Meeds Hope you enjoyed Meeds. You can tear down the server by following one of these options: From 363ef97e93073a208d6d8766a0e1d6ebc1af6ba3 Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 10 Jan 2024 16:02:44 +0100 Subject: [PATCH 10/14] Specify docker-compose project to avoid using directory as project name and tear up/down dissynchronisation --- gce.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gce.md b/gce.md index c2218c65..28acbf00 100644 --- a/gce.md +++ b/gce.md @@ -11,8 +11,8 @@ sudo sysctl -w vm.max_map_count=262144 ``` ## Start Meeds ```bash -docker-compose up -d -docker-compose logs -f meeds +docker-compose -p demo up -d +docker-compose -p demo logs -f meeds ``` Wait for Meeds startup. A log message should appear: @@ -25,15 +25,15 @@ After Meeds startup. Click on `Web preview` Date: Fri, 12 Jan 2024 15:02:32 +0100 Subject: [PATCH 11/14] Fix grammar typos --- gce.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gce.md b/gce.md index 28acbf00..241b4905 100644 --- a/gce.md +++ b/gce.md @@ -1,11 +1,11 @@ -# How to run ? +# How to run? ## Getting started -Weclome to Meeds-io Startup tutorial. Here we will show you how to run Meeds in few steps. To get started, click on Start! +Welcome to the Meeds-io Startup tutorial. Here we will show you how to run Meeds in a few steps. To get started, click on Start! ## VM Setup -Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions. See [doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html). +Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts are likely to be too low, which may result in out-of-memory exceptions. See [doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html). ```bash sudo sysctl -w vm.max_map_count=262144 ``` @@ -15,7 +15,7 @@ docker-compose -p demo up -d docker-compose -p demo logs -f meeds ``` -Wait for Meeds startup. A log message should appear: +Wait for Meeds's startup. A log message should appear: ``` | INFO | Server startup in [XXXXX] milliseconds [org.apache.catalina.startup.Catalina
] ``` @@ -27,16 +27,16 @@ Hope you enjoyed Meeds. You can tear down the server by following one of these o ```bash docker-compose -p demo stop ``` - - To stop Meeds with removing docker containers: + - To stop Meeds by removing docker containers: ```bash docker-compose -p demo down ``` - - To stop Meeds with removing docker containers and volumes: + - To stop Meeds by removing docker containers and volumes: ```bash docker-compose -p demo down -v ``` You can start again meeds by following the previous step. -You can checkout our Github [organisation](https://github.com/Meeds-io) and our [builders hub](https://builders.meeds.io). +You can check out our Github [organization](https://github.com/Meeds-io) and our [builders hub](https://builders.meeds.io). That's all :) \ No newline at end of file From 48f58b7dd57a91e01b3eaa016aed0e7ae31007cf Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Fri, 12 Jan 2024 15:04:42 +0100 Subject: [PATCH 12/14] Restore compose file & nginx and use custom gce compose file --- conf/nginx.conf | 46 ++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 14 ++++++++---- gce-compose.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++++ gce.md | 10 ++++----- 4 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 conf/nginx.conf create mode 100644 gce-compose.yml diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 00000000..a1eda675 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,46 @@ +user nginx; +worker_processes 1; + +events { + worker_connections 512; +} +http { + include mime.types; + server_tokens off; + + gzip on; + gzip_proxied any; + gzip_http_version 1.1; + gzip_comp_level 6; + gzip_types text/plain text/css text/javascript application/json application/x-javascript text/xml application/xml application/xml+rss; + gzip_disable msie6; + + upstream meeds-app { + server meeds:8080; + } + + server { + listen 80 default_server; + #server_name my.server.name; + + # Pass the client informations the the backend + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + client_max_body_size 0; + + # Websocket for Cometd + location /cometd/cometd { + proxy_pass http://meeds-app; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + + location / { + proxy_pass http://meeds-app; + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml index c50fa1b3..498f4707 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,16 @@ # version: '2' services: + web: + image: nginx:1.23-alpine + expose: + - "80" + ports: + - "80:80" + volumes: + - ./conf/nginx.conf:/etc/nginx/nginx.conf:ro + links: + - meeds meeds: image: ghcr.io/meeds-io/meeds/meeds-io:develop environment: @@ -33,10 +43,6 @@ services: volumes: - meeds_data:/srv/meeds - meeds_logs:/var/log/meeds - expose: - - "8080" - ports: - - "8080:8080" es: image: exoplatform/elasticsearch:2.0.3 volumes: diff --git a/gce-compose.yml b/gce-compose.yml new file mode 100644 index 00000000..c50fa1b3 --- /dev/null +++ b/gce-compose.yml @@ -0,0 +1,53 @@ +# +# This file is part of the Meeds project (https://meeds.io/). +# Copyright (C) 2020 Meeds Association +# contact@meeds.io +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +version: '2' +services: + meeds: + image: ghcr.io/meeds-io/meeds/meeds-io:develop + environment: + MEEDS_PROXY_VHOST: localhost + MEEDS_PROXY_PORT: 80 + MEEDS_PROXY_SSL: "false" + MEEDS_DB_NAME: meeds + MEEDS_DB_USER: meeds + MEEDS_DB_PASSWORD: my-secret-pw + MEEDS_ADDONS_LIST: + MEEDS_JVM_LOG_GC_ENABLED: "true" + MEEDS_ES_SCHEME: http + MEEDS_ES_HOST: es + MEEDS_ES_PORT: 9200 + volumes: + - meeds_data:/srv/meeds + - meeds_logs:/var/log/meeds + expose: + - "8080" + ports: + - "8080:8080" + es: + image: exoplatform/elasticsearch:2.0.3 + volumes: + - search_data:/usr/share/elasticsearch/data:rw + environment: + - ES_JAVA_OPTS=-Xms2048m -Xmx2048m + - node.name=meeds + - cluster.name=meeds + - cluster.initial_master_nodes=meeds + - network.host=_site_ +volumes: + meeds_data: + meeds_logs: + search_data: diff --git a/gce.md b/gce.md index 241b4905..f626147f 100644 --- a/gce.md +++ b/gce.md @@ -11,8 +11,8 @@ sudo sysctl -w vm.max_map_count=262144 ``` ## Start Meeds ```bash -docker-compose -p demo up -d -docker-compose -p demo logs -f meeds +docker-compose -f gce-compose.yml -p demo up -d +docker-compose -f gce-compose.yml -p demo logs -f meeds ``` Wait for Meeds's startup. A log message should appear: @@ -25,15 +25,15 @@ After Meeds startup. Click on `Web preview` Date: Wed, 24 Jan 2024 12:11:01 +0100 Subject: [PATCH 13/14] Update Header date --- gce-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gce-compose.yml b/gce-compose.yml index c50fa1b3..e59f993a 100644 --- a/gce-compose.yml +++ b/gce-compose.yml @@ -1,6 +1,6 @@ # # This file is part of the Meeds project (https://meeds.io/). -# Copyright (C) 2020 Meeds Association +# Copyright (C) 2024 Meeds Association # contact@meeds.io # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public From 7d9d86ce627e9511931dffd41a48d5acf6d5f67a Mon Sep 17 00:00:00 2001 From: Houssem Ben Ali Date: Wed, 24 Jan 2024 12:15:29 +0100 Subject: [PATCH 14/14] Update Readme link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5bcb124..71912a75 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Meeds Docker image -[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FMeeds-io%2Fmeeds-docker&cloudshell_git_branch=gce&cloudshell_tutorial=gce.md) +[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2FMeeds-io%2Fmeeds-docker&cloudshell_git_branch=develop&cloudshell_tutorial=gce.md) The image is compatible with the following databases system : `MySQL` (default) / `HSQLDB` / `PostgreSQL`