Dockerfile
1.1 KB
# 库存补货 · 云端(AgentScope + FastAPI)。构建上下文为 cloud/ 目录。
# 国内拉取慢请在 Docker Daemon 配置镜像加速器。
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=utf-8 \
PYTHONNOUSERSITE=1 \
TZ=Asia/Shanghai
WORKDIR /app
# APT 换清华源;装时区数据(日志/单据时间按北京时间)
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true \
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true \
&& apt-get update && apt-get install -y --no-install-recommends tzdata \
&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r requirements.txt
COPY replenish_cloud ./replenish_cloud
COPY config.example.toml ./
EXPOSE 53003
# config.toml / .env / data 目录由 docker-compose 挂载进来
CMD ["python", "-m", "replenish_cloud.main"]