From 26eaa637a7cc0ea39a60db20efd16f17e915f0bc Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 31 Jul 2026 11:55:23 +0200 Subject: [PATCH] fix: Robust PostgreSQL healthcheck and remove makemigrations on container startup for Coolify deployments --- docker-compose.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 79b5943..53ae43b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"