version: "3.8" services: db: image: postgres:15 container_name: polisplexity_postgres restart: always volumes: - pgdata:/var/lib/postgresql/data env_file: - .env ports: - "5434:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s retries: 5 timeout: 5s web: build: . container_name: polisplexity_django restart: always depends_on: db: condition: service_healthy volumes: - .:/app # Ensure correct project structure ports: - "8010:8001" env_file: - .env command: > sh -c "python manage.py migrate && python manage.py collectstatic --noinput && exec gunicorn --bind 0.0.0.0:8001 polisplexity.wsgi:application" volumes: pgdata: