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
|
source venv/bin/activate
|
||||||
|
|
||||||
echo "Updating database"
|
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_js_reverse
|
||||||
python manage.py collectstatic --noinput
|
python manage.py collectstatic --noinput
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
@ -9,11 +9,6 @@ services:
|
|||||||
- ./.env
|
- ./.env
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "psql -U $$POSTGRES_USER -d $$POSTGRES_DB --list || exit 1"]
|
|
||||||
interval: 4s
|
|
||||||
timeout: 1s
|
|
||||||
retries: 12
|
|
||||||
|
|
||||||
web_recipes:
|
web_recipes:
|
||||||
image: vabene1111/recipes
|
image: vabene1111/recipes
|
||||||
@ -25,8 +20,7 @@ services:
|
|||||||
- nginx_config:/opt/recipes/nginx/conf.d
|
- nginx_config:/opt/recipes/nginx/conf.d
|
||||||
- ./mediafiles:/opt/recipes/mediafiles
|
- ./mediafiles:/opt/recipes/mediafiles
|
||||||
depends_on:
|
depends_on:
|
||||||
db_recipes:
|
- db_recipes
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
@ -7,11 +7,6 @@ services:
|
|||||||
- ./postgresql:/var/lib/postgresql/data
|
- ./postgresql:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "psql -U $$POSTGRES_USER -d $$POSTGRES_DB --list || exit 1"]
|
|
||||||
interval: 4s
|
|
||||||
timeout: 1s
|
|
||||||
retries: 12
|
|
||||||
|
|
||||||
web_recipes:
|
web_recipes:
|
||||||
image: vabene1111/recipes
|
image: vabene1111/recipes
|
||||||
@ -23,8 +18,7 @@ services:
|
|||||||
- nginx_config:/opt/recipes/nginx/conf.d
|
- nginx_config:/opt/recipes/nginx/conf.d
|
||||||
- ./mediafiles:/opt/recipes/mediafiles
|
- ./mediafiles:/opt/recipes/mediafiles
|
||||||
depends_on:
|
depends_on:
|
||||||
db_recipes:
|
- db_recipes
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
nginx_recipes:
|
nginx_recipes:
|
||||||
image: nginx:mainline-alpine
|
image: nginx:mainline-alpine
|
||||||
|
@ -9,11 +9,6 @@ services:
|
|||||||
- ./.env
|
- ./.env
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "psql -U $$POSTGRES_USER -d $$POSTGRES_DB --list || exit 1"]
|
|
||||||
interval: 4s
|
|
||||||
timeout: 1s
|
|
||||||
retries: 12
|
|
||||||
|
|
||||||
web_recipes:
|
web_recipes:
|
||||||
image: vabene1111/recipes
|
image: vabene1111/recipes
|
||||||
@ -25,8 +20,7 @@ services:
|
|||||||
- nginx_config:/opt/recipes/nginx/conf.d
|
- nginx_config:/opt/recipes/nginx/conf.d
|
||||||
- ./mediafiles:/opt/recipes/mediafiles
|
- ./mediafiles:/opt/recipes/mediafiles
|
||||||
depends_on:
|
depends_on:
|
||||||
db_recipes:
|
- db_recipes
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user