version: '3.8' services: app: build: context: . environment: NODE_ENV: production restart: unless-stopped depends_on: postgres: condition: service_healthy minio: condition: service_healthy postgres: image: postgres:16-alpine environment: POSTGRES_DB: ${POSTGRES_DB:-GreenLens} POSTGRES_USER: ${POSTGRES_USER:-GreenLens} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-GreenLens}"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped # Expose to Railway/external — set firewall rules on your server! ports: - "5432:5432" minio: image: minio/minio:latest environment: MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:?MINIO_ACCESS_KEY is required} MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:?MINIO_SECRET_KEY is required} volumes: - minio_data:/data command: server /data --console-address ":9001" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped nginx: image: nginx:alpine ports: - "80:80" - "443:443" - "9000:9000" - "9001:9001" volumes: - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro - ./nginx/certs:/etc/nginx/certs:ro depends_on: - app - minio restart: unless-stopped volumes: postgres_data: minio_data: