build(docker): define restart policy

This commit is contained in:
Oliver Davies 2021-12-28 16:41:27 +00:00
parent 3651d69ce1
commit 8203e983d5
2 changed files with 10 additions and 4 deletions

View file

@ -5,3 +5,6 @@ INTEGROMAT_WEBHOOK_URL=
# Which environment is running? This should be "development" or "production". # Which environment is running? This should be "development" or "production".
# NODE_ENV=development # NODE_ENV=development
NODE_ENV=production NODE_ENV=production
# DOCKER_RESTART_POLICY=no
DOCKER_RESTART_POLICY=unless-stopped

View file

@ -11,7 +11,8 @@ services:
condition: service_started condition: service_started
ports: ports:
- "${DOCKER_WEB_PORT:-127.0.0.1:80}:80" - "${DOCKER_WEB_PORT:-127.0.0.1:80}:80"
restart: unless-stopped restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stop_grace_period: 3s
php: php:
build: build:
@ -25,7 +26,8 @@ services:
depends_on: depends_on:
mysql: mysql:
condition: service_healthy condition: service_healthy
restart: unless-stopped restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stop_grace_period: 3s
mysql: mysql:
image: mariadb:10 image: mariadb:10
@ -33,11 +35,12 @@ services:
- "${DOCKER_MYSQL_VOLUME:-./db-data:/var/lib/mysql}" - "${DOCKER_MYSQL_VOLUME:-./db-data:/var/lib/mysql}"
- ./tools/assets/development:/docker-entrypoint-initdb.d - ./tools/assets/development:/docker-entrypoint-initdb.d
env_file: env_file:
- .docker.env - .env
healthcheck: healthcheck:
test: ["CMD-SHELL", "bash", "-c", "echo > /dev/tcp/localhost/3306"] test: ["CMD-SHELL", "bash", "-c", "echo > /dev/tcp/localhost/3306"]
interval: 1s interval: 1s
restart: unless-stopped restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stop_grace_period: 3s
volumes: volumes:
assets: assets: