projects/repobot/v4/Dockerfile
24 Zeilen · 0.8 KBCode und Programmausgaben stehen genau so da, wie sie gelaufen sind – Kommentare und Ausgaben sind daher auf Chinesisch.
# 在 AI-Course 目录下构建:docker build -f projects/repobot/v4/Dockerfile -t repobot .
# 运行:docker run -p 8000:8000 -e LLM_API_KEY=你的密钥 repobot
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 先装只有 CPU 的 PyTorch,比默认的版本小得多;再装其他依赖
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
COPY projects/repobot/v4/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY data/httpx-docs /data/httpx-docs
COPY projects/repobot/v4 /app
ENV REPOBOT_DOCS=/data/httpx-docs \
LLM_BASE_URL=https://api.deepseek.com \
LLM_MODEL=deepseek-flash \
TOKENIZERS_PARALLELISM=false
EXPOSE 8000
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]