hr-eval-api-v2 / Dockerfile
KarenYYH
Initial commit - HR Evaluation API v2
c8b1f17
FROM python:3.9-slim
LABEL maintainer="HR Evaluation API"
LABEL description="HR Dialogue Quality Evaluation API with ML Models"
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
# 复制依赖文件
COPY requirements.txt .
# 安装Python依赖
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 复制项目文件(扁平结构)
COPY main.py config.py model_config.py ./
COPY data/ ./data/
COPY database/ ./database/
COPY middleware/ ./middleware/
COPY models/ ./models/
COPY routers/ ./routers/
COPY schemas/ ./schemas/
COPY services/ ./services/
COPY static/ ./static/
# 创建必要的目录
RUN mkdir -p models logs
# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# 暴露端口(HuggingFace Spaces Docker SDK 使用 7860)
EXPOSE 7860
# 启动命令 - 使用 shell 形式以便环境变量展开
CMD python -m uvicorn main:app --host 0.0.0.0 --port 7860