FROM python:3.10-slim

# 工作目录设为 /app/web，与 utils/paths.py 的 SCRIPT_DIR 推导一致
# gunicorn 直接加载 server 模块（server.py:107 已有模块级 app = create_app()）
WORKDIR /app/web

# 安装依赖（版本锁定，离线环境复现性保障）
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

# 拷贝代码
COPY skill/code/web/ /app/web/
COPY skill/code/SKILL.md /app/SKILL.md

# 端口
EXPOSE 8088

# 环境变量
ENV PYTHONIOENCODING=utf-8

# 启动：gunicorn 多 worker
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8088", "server:app"]
