# =============================================
# Finzone v2 — Production deployment (Next.js + native Postgres)
# Targets LXC 192.168.40.25 (Postgres chạy native trên host, không container hoá
# vì LXC unprivileged không bind được port < 1024 / sysctl)
# =============================================
services:
  app:
    image: ${IMAGE_TAG:-192.168.40.20:5000/finzone-v2:latest}
    container_name: finzone-app
    restart: unless-stopped
    env_file: .env
    environment:
      NODE_ENV: production
      PORT: "3000"
      HOSTNAME: "0.0.0.0"
    network_mode: host
    volumes:
      - finzone-uploads:/app/public/uploads
    healthcheck:
      test: ["CMD", "curl", "-fsS", "http://localhost:3000/api/v1/healthz"]
      interval: 30s
      timeout: 5s
      start_period: 30s
      retries: 3
    logging:
      driver: json-file
      options: { max-size: "10m", max-file: "5" }

volumes:
  finzone-uploads:
