services:
  nrel-app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nrel-2025
    restart: unless-stopped
    ports:
      # Use high port (>1024) to avoid cPanel firewall interference
      - "50000:3000"
    environment:
      - NODE_ENV=production
      - NEXT_TELEMETRY_DISABLED=1
      # Trust proxy headers from Apache
      - HOSTNAME=0.0.0.0
      - PORT=3000
    networks:
      - nrel-network
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://localhost:3000/",
        ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    # Logging configuration for production
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

networks:
  nrel-network:
    driver: bridge
