-
Notifications
You must be signed in to change notification settings - Fork 27
Rework docker compose for swarm support #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
5140c36
f4372c4
a6b8a6c
98cb069
0ea15e6
38500d7
47e9781
dfe5c16
9bfb33f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,18 @@ | ||
| # geOrchestra on Docker | ||
|
|
||
| ## Preconisation | ||
|
|
||
| This repository is meant to offer a convenient way to start geOrchestra for **development** or **demo** purposes. Production use is not recommended without hardening measures. | ||
|
|
||
| If you want to use this for production you might need to: | ||
| 1. modify the way to use certificates | ||
| 2. remove databases (database and postgis deployment and related volumes) from docker-compose | ||
| 3. update [.envs](envs/) files | ||
| 4. remove unwanted open ports | ||
| 5. modify volumes management (don't let docker service do it..), you might want to store them in specific path | ||
| 6. refit resources allocation with your use (Xmx Xms) | ||
|
|
||
|
|
||
| ## Quick Start | ||
|
|
||
| **1. Prerequisite** | ||
|
|
@@ -25,14 +36,16 @@ git clone --recurse-submodules https://github.com/georchestra/docker.git | |
|
|
||
| Choose which branch to run, eg for latest stable: | ||
| ``` | ||
| git checkout 24.0 && git submodule update | ||
| git checkout 25.0 && git submodule update | ||
| ``` | ||
|
|
||
| **3. Run** | ||
|
|
||
| **3.1 Docker compose** | ||
|
|
||
| The default docker-compose file contains all geOrchestra modules. | ||
|
|
||
| It's recommended to double-check the `docker-compose.yml` and `docker-compose.override.yml` files if you need to comment useless modules (e.g extractor, mapstore,... ). | ||
| It's recommended to double-check the `docker-compose.yml` file if you need to comment useless modules (e.g ogc-api-records, mapstore,... ). | ||
|
|
||
| You need to use the new Compose plugin V2, `docker-compose` (V1) is not supported by default: [https://docs.docker.com/compose/install/linux/](https://docs.docker.com/compose/install/linux/). | ||
| If you still want to use the old `docker-compose` (V1), you need to remove all the parameters `depends_on` from the files `docker-compose.yml` and `docker-compose.override.yml`. | ||
|
|
@@ -50,6 +63,43 @@ To stop geOrchestra: | |
| docker compose down | ||
| ``` | ||
|
|
||
| **3.2 Docker swarm** | ||
|
|
||
| [docker-compose.swarm.yml](docker-compose.swarm.yml) contains spécific services needed for deploying it in swarm | ||
|
|
||
| In order to run you will need to run those few commands: | ||
|
|
||
| To initialize your cluster | ||
| ``` | ||
| docker swarm init | ||
| ``` | ||
| To deploy/redeploy (after modification of the docker-compose) georchestra: | ||
| ``` | ||
| docker stack deploy -c docker-compose.yml -c docker-compose.swarm.yml georchestra | ||
| ``` | ||
| verify the stack is present | ||
| ``` | ||
| docker stack ls | ||
| ``` | ||
| Verify that services are running | ||
| ``` | ||
| docker stack services georchestra | ||
| ``` | ||
| To access the log of the gateway for instance you can use: | ||
| ``` | ||
| docker service logs georchestra_gateway | ||
| ``` | ||
| To restart a service : | ||
| ``` | ||
| docker service update --force georchestra_gateway | ||
| ``` | ||
| To stop/delete the deployment: | ||
| ``` | ||
| docker stack rm georchestra | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| **4. Play** | ||
|
|
||
| Open [https://georchestra-127-0-0-1.nip.io/](https://georchestra-127-0-0-1.nip.io/) in your browser. Then: | ||
|
|
@@ -69,9 +119,7 @@ rsync -arv -e 'ssh -p 2222' /path/to/geodata/ geoserver@georchestra-127-0-0-1.ni | |
|
|
||
| Files uploaded into this volume will also be available to the geoserver instance in `/mnt/geoserver_geodata/`. | ||
|
|
||
| Emails sent by the SDI (eg when users request a new password) will not be relayed on the internet but trapped by a local SMTP service. | ||
| These emails can be read on https://georchestra-127-0-0-1.nip.io/webmail/ (with login `smtp` and password `smtp`). | ||
|
|
||
| Emails sent by the SDI (eg when users request a new password) will not be relayed on the internet but trapped by a local SMTP service. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ? Trapped ? AFAIK, with the new config, we have an smtp relay, that will not really work since it's not configured by default.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "trapped by a local SMTP service." is not true anymore, or is it ? |
||
|
|
||
| ## Locally trust the TLS certificate for geOrchestra | ||
|
|
||
|
|
@@ -117,17 +165,12 @@ These docker-compose files describe: | |
| * how they are linked together, | ||
| * where the configuration and data volumes are | ||
|
|
||
| The `docker-compose.override.yml` file adds services to interact with your geOrchestra instance (they are not part of geOrchestra "core"): | ||
| * reverse proxy / load balancer | ||
| * ssh / rsync services, | ||
| * smtp, webmail. | ||
|
|
||
| **Feel free to comment out the apps you do not need**. | ||
|
|
||
| The base docker composition does not include any standalone geowebcache instance, nor the atlas module. | ||
| If you need them, you have to include the corresponding complementary docker-compose file at run-time: | ||
| ``` | ||
| docker compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.gwc.yml -f docker-compose.atlas.yml up | ||
| docker compose -f docker-compose.yml up | ||
| ``` | ||
|
|
||
| ## Upgrading | ||
|
|
@@ -144,11 +187,11 @@ To upgrade, we recommend you to: | |
| This docker composition supports environment variables, if you need to customize something it might be in the different environment variables files. | ||
|
|
||
| Here is the list of these files: | ||
| - [.envs-common](.envs-common) | ||
| - [.envs-database-datafeeder](.envs-database-datafeeder) | ||
| - [.envs-database-georchestra](.envs-database-georchestra) | ||
| - [.envs-hosts](.envs-hosts) | ||
| - [.envs-ldap](.envs-ldap) | ||
| - [.envs-common](envs/.envs-common) | ||
| - [.envs-database-datafeeder](envs/.envs-database-datafeeder) | ||
| - [.envs-database-georchestra](envs/.envs-database-georchestra) | ||
| - [.envs-hosts](envs/.envs-hosts) | ||
| - [.envs-ldap](envs/.envs-ldap) | ||
|
|
||
| If you add variables, be careful because it might be added into the wrong/unwanted container. | ||
|
|
||
|
|
@@ -169,7 +212,7 @@ Most changes will require a service restart, except maybe updating viewer contex | |
|
|
||
| In order to have Kibana up and running, you will need to: | ||
| 1. After Elasticsearch up and healthy, launch the command `docker compose exec -it elasticsearch bin/elasticsearch-reset-password -u kibana_system`. It will ask to fill a password for the `kibana_system` user. | ||
| 2. Uncomment and fill this password into the `.envs-elastic` file. | ||
| 2. Uncomment and fill this password into the `envs/.envs-elastic` file. | ||
| 3. Enable kibana server with `scale: 1` in `docker-compose.yml`. | ||
| 4. Start Kibana with `docker compose up -d kibana`. | ||
|
|
||
|
|
@@ -234,11 +277,11 @@ https://techoverflow.net/2019/04/17/how-to-disable-elasticsearch-disk-quota-wate | |
|
|
||
| Beside georchestra/docker directory, you need to clone [georchestra/georchestra repo](https://github.com/georchestra/georchestra) first. | ||
|
|
||
| Next, install maven to execute [main georchestra Makefile](https://github.com/georchestra/georchestra/blob/master/Makefile) on each modification (e.g console, security-proxy, whatever you change). | ||
| Next, install maven to execute [main georchestra Makefile](https://github.com/georchestra/georchestra/blob/master/Makefile) on each modification (e.g console, gateway, whatever you change). | ||
|
|
||
| For example, if you change some security-proxy code, use : | ||
| For example, if you change some gateway code, use : | ||
|
|
||
| `make docker-build-proxy` | ||
| `make docker-build-gateway` | ||
|
|
||
| ... to execute easily this maven command : | ||
|
|
||
|
|
@@ -254,25 +297,30 @@ You can now test modifications locally with the current FQDN (by default `georch | |
|
|
||
| **3. Debug** | ||
|
|
||
| Open `docker/docker-compose.yml` and identify `proxy` section. | ||
| Open `docker/docker-compose.yml` and identify `gateway` section. | ||
|
|
||
| Change `proxy` section to insert some JAVA options and ports `5005` to get : | ||
| Change `gateway` section to insert some JAVA options and ports `5005` to get : | ||
|
|
||
| ``` | ||
| proxy: | ||
| image: georchestra/security-proxy:latest | ||
| gateway: | ||
| image: georchestra/gateway:latest-debug | ||
| depends_on: | ||
| - ldap | ||
| - database | ||
| - database | ||
| volumes: | ||
| - georchestra_datadir:/etc/georchestra | ||
| - ./config:/etc/georchestra | ||
| environment: | ||
| - JAVA_OPTIONS=-Dorg.eclipse.jetty.annotations.AnnotationParser.LEVEL=OFF -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005 | ||
| - XMS=256M | ||
| - XMX=1G | ||
| - JAVA_OPTIONS=-Dorg.eclipse.jetty.annotations.AnnotationParser.LEVEL=OFF -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005 | ||
| - XMS=256M | ||
| - XMX=1G | ||
| env_file: | ||
| - ./envs/.envs-common | ||
| - ./envs/.envs-ldap | ||
| - ./envs/.envs-hosts | ||
| - ./envs/.envs-database-georchestra | ||
| restart: always | ||
| ports: | ||
| - "5005:5005" | ||
| - "5005:5005" | ||
| - "8080:8080" | ||
| ``` | ||
|
|
||
| Apply Docker changes : | ||
|
|
||
| +0 −15 | console/templates/new-oauth2-account-notification-template.txt | |
| +2 −2 | datafeeder/metadata_template-19115-3.xml | |
| +1 −1 | datafeeder/metadata_template.xml | |
| +2 −2 | datafeeder/metadata_transform-19115-3.xsl | |
| +1 −1 | datafeeder/metadata_transform.xsl | |
| +4 −4 | datahub/conf/default.toml | |
| +17 −0 | default.properties | |
| +0 −73 | gaia/celeryconfig.py | |
| +0 −7 | gaia/config.py | |
| +0 −8 | gaia/gunicorn.conf.py | |
| +0 −3 | gateway/application.yaml | |
| +1 −5 | gateway/security.yaml | |
| +0 −96 | maelstro/HOWTO.md | |
| +0 −5 | maelstro/README.md | |
| +0 −37 | maelstro/config.yaml | |
| +0 −35 | maelstro/scripts/add-header-webcomponent.sh | |
| +0 −48 | maelstro/xsl_transforms/test_public_to_prod.xsl | |
| +108 −303 | mapstore/configs/localConfig.json | |
| + − | mapstore/printing/print_header.png |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.