Moved db-waiting from docker-level to container-level
This commit is contained in:
5
boot.sh
5
boot.sh
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user