fix: Robust PostgreSQL healthcheck and remove makemigrations on container startup for Coolify deployments
This commit is contained in:
+5
-8
@@ -1,5 +1,3 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
# Coolify & Production Ready Docker Compose Configuration
|
# Coolify & Production Ready Docker Compose Configuration
|
||||||
# Traefik in Coolify automatically routes traffic to the 'frontend' service on port 80 via expose.
|
# Traefik in Coolify automatically routes traffic to the 'frontend' service on port 80 via expose.
|
||||||
# Host port bindings (ports) are omitted to avoid host port 80 conflicts with Traefik.
|
# Host port bindings (ports) are omitted to avoid host port 80 conflicts with Traefik.
|
||||||
@@ -17,18 +15,17 @@ services:
|
|||||||
- "5432"
|
- "5432"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shiftplan_user} -d ${POSTGRES_DB:-shiftplan_db}"]
|
test: ["CMD-SHELL", "pg_isready"]
|
||||||
interval: 5s
|
interval: 3s
|
||||||
timeout: 5s
|
timeout: 3s
|
||||||
retries: 5
|
retries: 10
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
command: >
|
command: >
|
||||||
sh -c "python manage.py makemigrations --noinput &&
|
sh -c "python manage.py migrate --noinput &&
|
||||||
python manage.py migrate --noinput &&
|
|
||||||
python manage.py collectstatic --noinput &&
|
python manage.py collectstatic --noinput &&
|
||||||
python manage.py create_admin &&
|
python manage.py create_admin &&
|
||||||
gunicorn --bind 0.0.0.0:8000 --workers 3 shiftplan_backend.wsgi:application"
|
gunicorn --bind 0.0.0.0:8000 --workers 3 shiftplan_backend.wsgi:application"
|
||||||
|
|||||||
Reference in New Issue
Block a user