ForcePilot/docker/api.Dockerfile
Wenjie Zhang 3fa05037d8 feat: 更新 Dockerfile 和配置文件 #202
- 删除 uv.lock 文件,简化依赖管理。
- 新增 api-pip.Dockerfile,设置 Python 环境并安装依赖。
2025-06-04 10:43:00 +08:00

39 lines
879 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.12
COPY --from=ghcr.io/astral-sh/uv:0.7.2 /uv /uvx /bin/
# 设置工作目录
WORKDIR /app
# 环境变量设置
ARG http_proxy
ARG https_proxy
ENV http_proxy=$http_proxy \
https_proxy=$https_proxy \
TZ=Asia/Shanghai \
UV_LINK_MODE=copy
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 安装系统依赖
RUN apt-get update && apt-get install -y \
python3-dev \
ffmpeg \
libsm6 \
libxext6
# 复制项目配置文件
COPY ../pyproject.toml /app/pyproject.toml
COPY ../.python-version /app/.python-version
# 安装依赖项不使用lock文件
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-install-project
# 复制代码到容器中
COPY ../src /app/src
COPY ../server /app/server
# 同步项目
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync