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
|
||||
# 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.
|
||||
@@ -17,18 +15,17 @@ services:
|
||||
- "5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shiftplan_user} -d ${POSTGRES_DB:-shiftplan_db}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
command: >
|
||||
sh -c "python manage.py makemigrations --noinput &&
|
||||
python manage.py migrate --noinput &&
|
||||
sh -c "python manage.py migrate --noinput &&
|
||||
python manage.py collectstatic --noinput &&
|
||||
python manage.py create_admin &&
|
||||
gunicorn --bind 0.0.0.0:8000 --workers 3 shiftplan_backend.wsgi:application"
|
||||
|
||||
Reference in New Issue
Block a user