services:
  kamco-train-api:
    build:
      context: .
      dockerfile: Dockerfile
    image: kamco-train-api:${IMAGE_TAG:-latest}
    container_name: kamco-train-api
    expose:
      - "8080"
    environment:
      - SPRING_PROFILES_ACTIVE=prod
      - TZ=Asia/Seoul
    volumes:
      - ./app/model_output:/app/model-outputs
      - ./app/train_dataset:/app/train-dataset
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - kamco-cds
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/monitor/health"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 40s

networks:
  kamco-cds:
    external: true
