version: '3.8' services: # PostgreSQL Database postgres: image: postgres:15-alpine container_name: buildmate-postgres restart: unless-stopped environment: POSTGRES_USER: buildmate POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-buildmate_password_change_me} POSTGRES_DB: buildmate volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U buildmate"] interval: 10s timeout: 5s retries: 5 # Next.js Application nextjs: build: context: . dockerfile: Dockerfile container_name: buildmate-nextjs restart: unless-stopped ports: - "3000:3000" environment: - NODE_ENV=production - NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL} - NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY} - SUPABASE_SERVICE_ROLE_KEY=${SUPABASE_SERVICE_ROLE_KEY} - DATABASE_URL=postgresql://buildmate:${POSTGRES_PASSWORD:-buildmate_password_change_me}@postgres:5432/buildmate - SMTP_HOST=${SMTP_HOST} - SMTP_PORT=${SMTP_PORT} - SMTP_USER=${SMTP_USER} - SMTP_PASSWORD=${SMTP_PASSWORD} - SMTP_FROM_EMAIL=${SMTP_FROM_EMAIL} - SMTP_FROM_NAME=${SMTP_FROM_NAME} - PYTHON_API_URL=http://python-api:5000 depends_on: postgres: condition: service_healthy python-api: condition: service_started networks: - buildmate-network # Python API Backend python-api: build: context: . dockerfile: Dockerfile.python container_name: buildmate-python-api restart: unless-stopped ports: - "5000:5000" environment: - DATABASE_URL=postgresql://buildmate:${POSTGRES_PASSWORD:-buildmate_password_change_me}@postgres:5432/buildmate - SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL} - SUPABASE_KEY=${SUPABASE_SERVICE_ROLE_KEY} depends_on: postgres: condition: service_healthy networks: - buildmate-network volumes: postgres_data: networks: buildmate-network: driver: bridge