Files
xingrin/docker/server/Dockerfile
yyhuni d484133e4c chore(docker): optimize server dockerfile with docker-ce-cli installation
- Replace full docker.io package with lightweight docker-ce-cli to reduce image size
- Add ca-certificates and gnupg dependencies for secure package management
- Improve Docker installation process for local Worker task distribution
- Reduce unnecessary dependencies in server container build
2026-01-03 08:09:03 +08:00

40 lines
947 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-bookworm
WORKDIR /app
# 安装系统依赖 (用于编译某些 Python 包)
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# 安装 Docker CLI用于本地 Worker 任务分发)
# 只安装 docker-ce-cli避免安装完整 Docker 引擎
RUN apt-get update && \
apt-get install -y ca-certificates gnupg && \
install -m 07
# 安装 uv超快的 Python 包管理器)
RUN pip install uv
# 安装 Python 依赖(使用 uv 并行下载,速度快 10-100 倍)
COPY backend/requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system -r requirements.txt
# 复制后端代码
COPY backend /app/backend
ENV PYTHONPATH=/app/backend
# 暴露端口
# 8888: Django/uvicorn
EXPOSE 8888
# 复制启动脚本
COPY docker/server/start.sh /app/start.sh
RUN chmod +x /app/start.sh
CMD ["/app/start.sh"]