Files
huihuiSquare/digital-avatar-app/backend/Dockerfile
2026-07-24 14:04:21 +08:00

16 lines
580 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM python:3.10-slim
WORKDIR /app
# 后端依赖fastapi/uvicorn/sqlalchemy/pypdf/python-docx/openpyxl 等)均为纯 Python wheel
# 无需 gcc 等编译链,故跳过 apt 安装以加快构建并减小镜像体积。
COPY requirements.txt .
RUN pip install --no-cache-dir --timeout 120 --retries 10 -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY . .
# 后端使用 SQLiteavatar.db 落在 /app 内),平铺结构以 `uvicorn main:app` 启动
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]