services:
  narratoai-webui:
    build:
      context: .
      dockerfile: Dockerfile
    image: narratoai:latest
    container_name: narratoai-webui

    ports:
      - "8501:8501"

    volumes:
      - ./storage:/NarratoAI/storage
      - ./config.toml:/NarratoAI/config.toml
      - ./resource:/NarratoAI/resource:rw

    environment:
      - PYTHONUNBUFFERED=1
      - TZ=Asia/Shanghai

    restart: unless-stopped

    # 健康检查
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
