1s faster interval (to increase retry speed on faster systems), 1s shorter timeout (since it db should react in a lot less than 1s), increased retries to 12 total so all adds up to 60s of potential retry-time for older systems (e.g. RPI 3)
57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
version: "3"
|
|
services:
|
|
db_recipes:
|
|
restart: always
|
|
image: postgres:11-alpine
|
|
volumes:
|
|
- ./postgresql:/var/lib/postgresql/data
|
|
env_file:
|
|
- ./.env
|
|
networks:
|
|
- default
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "psql -U $$POSTGRES_USER -d $$POSTGRES_DB --list || exit 1"]
|
|
interval: 4s
|
|
timeout: 1s
|
|
retries: 12
|
|
|
|
web_recipes:
|
|
image: vabene1111/recipes
|
|
restart: always
|
|
env_file:
|
|
- ./.env
|
|
volumes:
|
|
- staticfiles:/opt/recipes/staticfiles
|
|
- nginx_config:/opt/recipes/nginx/conf.d
|
|
- ./mediafiles:/opt/recipes/mediafiles
|
|
depends_on:
|
|
db_recipes:
|
|
condition: service_healthy
|
|
networks:
|
|
- default
|
|
|
|
nginx_recipes:
|
|
image: nginx:mainline-alpine
|
|
restart: always
|
|
env_file:
|
|
- ./.env
|
|
depends_on:
|
|
- web_recipes
|
|
volumes:
|
|
- nginx_config:/etc/nginx/conf.d:ro
|
|
- staticfiles:/static
|
|
- ./mediafiles:/media
|
|
networks:
|
|
- default
|
|
- nginx-proxy
|
|
|
|
networks:
|
|
default:
|
|
nginx-proxy:
|
|
external:
|
|
name: nginx-proxy
|
|
|
|
volumes:
|
|
nginx_config:
|
|
staticfiles:
|