services: # Next.js Application (Production Mode) app: build: context: ./proto dockerfile: Dockerfile target: runner # Use runner stage for production (smaller size, no dev dependencies) args: - NEXT_PUBLIC_SITE_URL=${NEXT_PUBLIC_SITE_URL:-https://mozdit.hu} - DEPLOY_VERSION=${DEPLOY_VERSION:-unversioned} container_name: mozdit-app-prod ports: - "127.0.0.1:8080:3000" # Belső port — csak nginx reverse proxy-n keresztül elérhető environment: - NODE_ENV=production # MITHOME-136: PostgreSQL (the site's own database on the shared server). # Built from POSTGRES_PASSWORD so the secret lives in one place; no # fallback — a missing password must fail the deploy loudly. Use a # URL-safe password (e.g. `openssl rand -hex 32`). - DATABASE_URI=postgresql://${POSTGRES_USER:-mozdit_web}:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}@postgres:5432/mozdit_web # No fallback either (MITHOME-97): Payload refuses to start without a real # secret ("missing secret key"), which is exactly what we want here. - PAYLOAD_SECRET=${PAYLOAD_SECRET} - NEXT_PUBLIC_SITE_URL=${NEXT_PUBLIC_SITE_URL:-https://mozdit.hu} - NEXT_PUBLIC_COMPANY_NAME=${NEXT_PUBLIC_COMPANY_NAME:-mozdIT Bt.} - NEXT_PUBLIC_CONTACT_EMAIL=${NEXT_PUBLIC_CONTACT_EMAIL:-info@mozdit.hu} volumes: # Payload helyi upload storage — lásd docker-compose.staging.yml azonos # kommentjét (MITHOME-97). - media_data_prod:/app/media depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 60s networks: - mozdit-network restart: always logging: driver: "json-file" options: max-size: "10m" max-file: "3" # PostgreSQL (MITHOME-136) — llmdev Docker spec: healthcheck, log limit, # memory limit, no host port (the app reaches it on the project network). postgres: image: postgres:16-alpine container_name: mozdit-postgres-prod environment: - POSTGRES_DB=mozdit_web - POSTGRES_USER=${POSTGRES_USER:-mozdit_web} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required} volumes: - postgres_data_prod:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-mozdit_web} -d mozdit_web"] interval: 10s timeout: 5s retries: 5 start_period: 20s deploy: resources: limits: memory: 1G logging: driver: "json-file" options: max-size: "100m" max-file: "3" networks: - mozdit-network restart: unless-stopped volumes: postgres_data_prod: driver: local media_data_prod: driver: local networks: mozdit-network: driver: bridge