Skip to content

Commit

Permalink
Fix restart-policy for all container
Browse files Browse the repository at this point in the history
  • Loading branch information
hypsug0 authored and jacquesfize committed Sep 30, 2024
1 parent caadb0b commit 92146f2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: "3.9"

x-restart-policy: &restart-policy
restart: ${RESTART_POLICY:-unless-stopped}

x-defaults: &defaults
user: ${UID}:${GID}
restart: ${RESTART_POLICY:-unless-stopped}

x-env-defaults: &env-defaults
http_proxy: ${HTTP_PROXY:-}
Expand Down Expand Up @@ -38,6 +40,7 @@ x-geonature-backend-defaults: &geonature-backend-defaults

services:
traefik:
<<: *restart-policy
image: traefik:2.10.4
command:
- "--providers.docker=true"
Expand All @@ -58,6 +61,7 @@ services:
- ${HTTPS_PORT:-443}:443

redis:
<<: *restart-policy
image: ${REDIS_IMAGE:-redis:7-alpine}
volumes:
- redis:/data
Expand All @@ -68,6 +72,7 @@ services:
retries: 5

postgres:
<<: *restart-policy
image: ${POSTGRES_IMAGE:-postgis/postgis:15-3.4}
environment:
POSTGRES_DB: ${POSTGRES_DB}
Expand All @@ -85,7 +90,7 @@ services:
retries: 5

usershub:
<<: *defaults
<<: [*restart-policy,*defaults]
image: ${USERSHUB_IMAGE}
depends_on:
postgres:
Expand All @@ -110,7 +115,7 @@ services:
- "traefik.http.routers.usershub.tls.certResolver=acme-resolver"

taxhub:
<<: *defaults
<<: [*restart-policy,*defaults]
image: ${TAXHUB_IMAGE}
depends_on:
postgres:
Expand Down Expand Up @@ -152,7 +157,7 @@ services:
taxhub_samples: ${GEONATURE_DB_INSTALL_TAXHUB_SAMPLES:-true}

geonature-worker:
<<: *geonature-backend-defaults
<<: [*restart-policy,*geonature-backend-defaults]
depends_on:
<<: *geonature-depends-on-defaults
geonature-install-db:
Expand All @@ -161,7 +166,7 @@ services:
command: celery -A geonature.celery_app:app worker --beat --schedule-filename=/dist/media/celerybeat-schedule.db

geonature-backend:
<<: *geonature-backend-defaults
<<: [*restart-policy,*geonature-backend-defaults]
depends_on:
<<: *geonature-depends-on-defaults
geonature-install-db:
Expand All @@ -184,6 +189,7 @@ services:
- "traefik.http.routers.geonature-backend.tls.certResolver=acme-resolver"

geonature-frontend:
<<: *restart-policy
image: ${GEONATURE_FRONTEND_EXTRA_IMAGE}
environment:
- NGINX_LOCATION=${GEONATURE_FRONTEND_PREFIX}
Expand Down

0 comments on commit 92146f2

Please sign in to comment.