version: "3.8"

services:
  # Node.js 백엔드
  backend:
    build:
      context: ./backend-node
      dockerfile: Dockerfile.win
    container_name: pms-backend-win
    ports:
      - "8080:8080"
    environment:
      - NODE_ENV=development
      - PORT=8080
      - DATABASE_URL=${DATABASE_URL}
      - JWT_SECRET=${JWT_SECRET}
      - JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-24h}
      - ENCRYPTION_KEY=${ENCRYPTION_KEY}
      - CORS_ORIGIN=http://localhost:9771
      - CORS_CREDENTIALS=true
      - LOG_LEVEL=debug
    volumes:
      - ./backend-node:/app
      - /app/node_modules
      - /app/dist
    networks:
      - pms-network
    restart: unless-stopped
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://localhost:8080/health",
          "||",
          "exit",
          "1",
        ]
      interval: 30s
      timeout: 15s
      retries: 5
      start_period: 90s

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