From b1302e04865715ac50388ede6bd31c583e08f7bd Mon Sep 17 00:00:00 2001 From: Alex Garel Date: Thu, 8 Aug 2024 14:54:37 +0200 Subject: [PATCH] build: change restart policy (#533) * default to production settings * add it to every service --- .env | 3 +++ docker-compose.yml | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 7078ea51..4919d349 100644 --- a/.env +++ b/.env @@ -5,6 +5,9 @@ COMPOSE_FILE=docker-compose.yml;docker/dev.yml # version DOCKER_TAG=dev +# no restart on dev mode (we want to launch containers only on demand) +RESTART_POLICY=no + # domain name TAXONOMY_EDITOR_DOMAIN=taxonomy.localhost # exposition diff --git a/docker-compose.yml b/docker-compose.yml index 0e2a436f..42aeeb36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: neo4j: - restart: ${RESTART_POLICY:-no} + restart: ${RESTART_POLICY:-always} image: neo4j:5.14.0-community ports: # admin console @@ -28,7 +28,7 @@ services: # directory for neo4j imports command: neo4j taxonomy_api: - restart: ${RESTART_POLICY:-no} + restart: ${RESTART_POLICY:-always} image: ghcr.io/openfoodfacts/taxonomy-editor/taxonomy_api:${DOCKER_TAG} environment: NEO4J_URI: "bolt://neo4j:7687" @@ -40,6 +40,7 @@ services: FORWARDED_ALLOW_IPS: "*" taxonomy_frontend: # this is the nginx frontend serving react static version or redirecting queries + restart: ${RESTART_POLICY:-always} image: ghcr.io/openfoodfacts/taxonomy-editor/taxonomy_frontend:${DOCKER_TAG} depends_on: - taxonomy_api