Files
gmv-analytics/Dockerfile
T

50 lines
1.7 KiB
Docker
Raw Normal View History

2026-03-24 17:00:14 +08:00
FROM ghcr.io/astral-sh/uv:latest AS uv
2026-03-13 18:55:33 +08:00
2026-03-24 17:00:14 +08:00
FROM python:3.12-slim-bookworm
COPY --from=uv /uv /bin/uv
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
2026-03-24 16:48:25 +08:00
UV_SYSTEM_PYTHON=1 \
UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" \
2026-03-24 17:00:14 +08:00
TZ=Asia/Shanghai \
PYTHONPATH="/app:${PYTHONPATH}"
2026-03-13 18:55:33 +08:00
2026-03-24 16:48:25 +08:00
RUN echo "# 清华大学 Debian 镜像源配置\n\
# 主软件源\n\
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n\
\n\
# 安全更新源\n\
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware\n\
\n\
# 更新源\n\
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
2026-03-24 17:00:14 +08:00
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
2026-03-13 18:55:33 +08:00
COPY . /app
2026-03-24 17:00:14 +08:00
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
2026-03-13 18:55:33 +08:00
ENTRYPOINT ["/app/docker-entrypoint.sh"]
2026-03-24 17:00:14 +08:00
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]