version: '3.9' services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: partymix POSTGRES_USER: partymix POSTGRES_PASSWORD: ${DB_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U partymix"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped backend: build: context: ./apps/backend dockerfile: Dockerfile environment: DB_HOST: postgres DB_PORT: 5432 DB_USER: partymix DB_PASSWORD: ${DB_PASSWORD} DB_NAME: partymix GIN_MODE: release PORT: 8080 JWT_SECRET: ${JWT_SECRET} ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost} SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID:-} SPOTIFY_CLIENT_SECRET: ${SPOTIFY_CLIENT_SECRET:-} depends_on: postgres: condition: service_healthy restart: unless-stopped web: build: context: ./apps/web dockerfile: Dockerfile args: NEXT_PUBLIC_API_URL: "" depends_on: - backend restart: unless-stopped nginx: image: nginx:alpine volumes: - ./apps/nginx/nginx.conf:/etc/nginx/nginx.conf:ro ports: - "${APP_PORT:-80}:80" depends_on: - web - backend restart: unless-stopped volumes: postgres_data: