version: "3.8"

services:
  # Next.js 프론트엔드만
  frontend:
    build:
      context: ./frontend
      dockerfile: ../docker/dev/frontend.Dockerfile
    container_name: pms-frontend-win
    ports:
      - "9771:3000"
    environment:
      - NEXT_PUBLIC_API_URL=http://localhost:8080/api
      - WATCHPACK_POLLING=true
      - NODE_OPTIONS=--max-old-space-size=4096
    deploy:
      resources:
        limits:
          memory: 6G
        reservations:
          memory: 2G
    volumes:
      - ./frontend:/app
      - /app/node_modules
      - /app/.next
    networks:
      - pms-network
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000", "||", "exit", "1"]
      interval: 30s
      timeout: 15s
      retries: 3
      start_period: 60s

networks:
  pms-network:
    driver: bridge
    external: false
