services:
  api:
    build: .
    container_name: jinro-api
    network_mode: host
    command: ["uvicorn", "api:app", "--host", "127.0.0.1", "--port", "8000", "--workers", "4"]
    env_file:
      - .env
    volumes:
      - ./notice.txt:/app/notice.txt:ro
    healthcheck:
      test: ["CMD", "python", "-c",
             "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s
    restart: unless-stopped

  batch:
    build: .
    container_name: jinro-batch
    profiles: ["batch"]
    command: ["python", "batch.py"]
    network_mode: host
    env_file:
      - .env
    restart: "no"
