Merge pull request #1437 from MaxJa4/improvement/wait_for_db

[Docker] Web_recipes waits for db_recipes to be ready
This commit is contained in:
vabene1111 2022-02-03 14:32:37 +01:00 committed by GitHub
commit ed852b3246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -9,6 +9,11 @@ services:
- ./.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
@ -20,7 +25,8 @@ services:
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
- db_recipes
db_recipes:
condition: service_healthy
networks:
- default

View File

@ -7,6 +7,11 @@ services:
- ./postgresql:/var/lib/postgresql/data
env_file:
- ./.env
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
@ -18,7 +23,8 @@ services:
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
- db_recipes
db_recipes:
condition: service_healthy
nginx_recipes:
image: nginx:mainline-alpine
@ -36,4 +42,4 @@ services:
volumes:
nginx_config:
staticfiles:
staticfiles:

View File

@ -9,6 +9,11 @@ services:
- ./.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
@ -20,7 +25,8 @@ services:
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
- db_recipes
db_recipes:
condition: service_healthy
networks:
- default
@ -51,4 +57,4 @@ networks:
volumes:
nginx_config:
staticfiles:
staticfiles: