Files
Sanjin 1921f9da0c feat: apikeydialog
add apikeydialog 在网页配置 apikey
不需要再环境变量
update docker file and github action
change prompt
跳过问题核验导致不非数学建模问题
2025-08-18 14:41:40 +08:00

26 lines
823 B
Docker
Raw Permalink 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.
# 使用官方推荐的 Python 基础镜像
FROM python:3.12-slim AS builder
# 安装 uv(推荐直接用官方 distroless 镜像复制二进制文件,速度快且干净)
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
# 先复制依赖文件,利用 Docker 层缓存
COPY pyproject.toml uv.lock ./
# 安装依赖(不安装项目本身,加快后续构建)
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-install-project
# 再复制项目代码
COPY . .
# 安装项目本身
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked
EXPOSE 8000
# 直接使用 uvicorn,因为依赖已安装到系统 Python
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--ws-ping-interval", "60", "--ws-ping-timeout", "120"]