diff --git a/docker/README.md b/docker/README.md index 302ee4c..e650b98 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,16 +4,7 @@ ``` export REGISTRY='registry.mapotempo.com/' -``` - -### geocoder -``` -docker build -f ./docker/Dockerfile -t ${REGISTRY}mapotempo-ce/geocoder-api:latest . -``` - -### addok -``` -docker build -f ./docker/addok/Dockerfile -t ${REGISTRY}mapotempo/addok:latest . +docker-compose -f docker-compose.yml -f docker-compose-build.yml build ``` ## Running services diff --git a/docker/docker-compose-build.yml b/docker/docker-compose-build.yml new file mode 100644 index 0000000..f2e9e18 --- /dev/null +++ b/docker/docker-compose-build.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + api: + build: + context: .. + dockerfile: docker/Dockerfile + + # France + addok-fr: + build: addok + + # Luxemburg + addok-lu: + build: addok diff --git a/docker/docker-compose-swarm.yml b/docker/docker-compose-swarm.yml new file mode 100644 index 0000000..4fef2dc --- /dev/null +++ b/docker/docker-compose-swarm.yml @@ -0,0 +1,34 @@ +version: '3.7' +services: + api: + deploy: + update_config: + order: start-first + restart_policy: + condition: any + + # France + addok-fr: + deploy: + update_config: + order: start-first + restart_policy: + condition: any + + redis-server-fr: + deploy: + restart_policy: + condition: any + + # Luxemburg + addok-lu: + deploy: + update_config: + order: start-first + restart_policy: + condition: any + + redis-server-lu: + deploy: + restart_policy: + condition: any diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1e2dc2a..895d54f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,11 +8,6 @@ services: - ./production.rb:/srv/app/config/environments/production.rb - ./access.rb:/srv/app/config/access.rb - ./poly:/srv/app/poly - deploy: - update_config: - order: start-first - restart_policy: - condition: any environment: APP_ENV: production # Swith to "development" for more traces REDIS_HOST: redis-cache @@ -26,9 +21,6 @@ services: redis-cache: image: redis:${REDIS_VERSION:-3.2-alpine} command: redis-server --save "" - deploy: - restart_policy: - condition: any networks: - redis_cache @@ -47,11 +39,6 @@ services: ADDOK_HOST: "redis-server-fr" ADDOK_ATTRIBUTION: "BANO" ADDOK_LICENCE: "ODbL" - deploy: - update_config: - order: start-first - restart_policy: - condition: any networks: - addok_fr - redis_server_fr @@ -61,9 +48,6 @@ services: volumes: - ./data-fr:/data command: redis-server --save "" - deploy: - restart_policy: - condition: any networks: - redis_server_fr @@ -76,11 +60,6 @@ services: ADDOK_HOST: "redis-server-lu" ADDOK_ATTRIBUTION: "Grand-Duché of Luxembourg" ADDOK_LICENCE: "CC0" - deploy: - update_config: - order: start-first - restart_policy: - condition: any networks: - addok_lu - redis_server_lu @@ -90,9 +69,6 @@ services: volumes: - ./data-lu:/data command: redis-server --save "" - deploy: - restart_policy: - condition: any networks: - redis_server_lu