2025-05-23 16:33:38 +08:00
|
|
|
FROM python:3.11-slim-bookworm
|
|
|
|
|
|
2026-05-11 08:31:43 +05:30
|
|
|
ARG NEED_MIRROR=1
|
|
|
|
|
|
2025-05-23 16:33:38 +08:00
|
|
|
COPY --from=ghcr.io/astral-sh/uv:0.7.5 /uv /uvx /bin/
|
2026-03-20 20:32:00 +08:00
|
|
|
ENV MPLBACKEND=Agg
|
|
|
|
|
ENV MPLCONFIGDIR=/tmp/matplotlib
|
2026-04-20 12:11:23 +08:00
|
|
|
ENV MATPLOTLIBRC=/usr/local/etc/matplotlibrc
|
2025-05-23 16:33:38 +08:00
|
|
|
|
|
|
|
|
COPY requirements.txt .
|
2026-04-20 12:11:23 +08:00
|
|
|
COPY matplotlibrc /usr/local/etc/matplotlibrc
|
2025-05-23 16:33:38 +08:00
|
|
|
|
2026-05-11 08:31:43 +05:30
|
|
|
RUN if [ "$NEED_MIRROR" = 1 ]; then \
|
|
|
|
|
grep -rl 'deb.debian.org' /etc/apt/ | xargs sed -i 's|http[s]*://deb.debian.org|https://mirrors.tuna.tsinghua.edu.cn|g'; \
|
|
|
|
|
export UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"; \
|
|
|
|
|
else \
|
|
|
|
|
export UV_INDEX_URL="https://pypi.org/simple"; \
|
|
|
|
|
fi; \
|
2025-05-23 16:33:38 +08:00
|
|
|
apt-get update && \
|
2026-05-11 08:31:43 +05:30
|
|
|
apt-get install -y --no-install-recommends curl gcc && \
|
2026-03-20 20:32:00 +08:00
|
|
|
mkdir -p /tmp/matplotlib && \
|
2026-05-11 08:31:43 +05:30
|
|
|
uv pip install --system -r requirements.txt && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2025-05-23 16:33:38 +08:00
|
|
|
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
|
|
2026-05-11 08:31:43 +05:30
|
|
|
CMD ["sleep", "infinity"]
|