添加执行需要的文件

This commit is contained in:
2026-03-24 17:00:14 +08:00
parent 6a6ef44132
commit 15b6f0525e
4 changed files with 66 additions and 16 deletions
+27 -12
View File
@@ -1,14 +1,15 @@
FROM python:3.12-slim
FROM ghcr.io/astral-sh/uv:latest AS uv
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FROM python:3.12-slim-bookworm
COPY --from=uv /uv /bin/uv
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_SYSTEM_PYTHON=1 \
UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" \
TZ=Asia/Shanghai
WORKDIR /app
COPY requirements-docker.txt /app/requirements-docker.txt
TZ=Asia/Shanghai \
PYTHONPATH="/app:${PYTHONPATH}"
RUN echo "# 清华大学 Debian 镜像源配置\n\
# 主软件源\n\
@@ -23,12 +24,26 @@ deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" > /etc/apt/sources.list
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /app/requirements-docker.txt
RUN apt-get update && apt-get install -y --no-install-recommends \
supervisor \
tzdata \
&& ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml /app/pyproject.toml
RUN uv pip install -r /app/pyproject.toml
COPY . /app
RUN chmod +x /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh \
&& mkdir -p /app/logs \
&& mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["python", "prefect_gmv_scheduler.py", "--serve"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]