Moved db-waiting from docker-level to container-level

This commit is contained in:
MaxJa4
2022-02-06 18:54:42 +01:00
parent 65003175ce
commit 773d2eff37
4 changed files with 7 additions and 22 deletions

View File

@ -2,7 +2,10 @@
source venv/bin/activate
echo "Updating database"
python manage.py migrate
while python manage.py migrate ; status=$? ; [ $status -eq 1 ]; do
echo "Migration failed due to database not being ready yet, retrying in 5 seconds..."
sleep 5
done
python manage.py collectstatic_js_reverse
python manage.py collectstatic --noinput
echo "Done"

View File

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

View File

@ -7,11 +7,6 @@ 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
@ -23,8 +18,7 @@ services:
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
db_recipes:
condition: service_healthy
- db_recipes
nginx_recipes:
image: nginx:mainline-alpine

View File

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