Add optional apt/PyPI mirrors and HTTP_PORT

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-05 09:12:41 +03:30
parent a3a99411c6
commit 20c2cc018c
4 changed files with 47 additions and 6 deletions

View File

@@ -3,6 +3,26 @@ FROM python:3.14-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ARG APT_MIRROR=
ARG PIP_INDEX_URL=
ARG PIP_TRUSTED_HOST=
# Optional Debian apt mirror (host only, e.g. mirror.example.com)
RUN if [ -n "$APT_MIRROR" ]; then \
if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
sed -i "s|deb.debian.org|${APT_MIRROR}|g; s|security.debian.org|${APT_MIRROR}|g" \
/etc/apt/sources.list.d/debian.sources; \
fi; \
if [ -f /etc/apt/sources.list ]; then \
sed -i "s|deb.debian.org|${APT_MIRROR}|g; s|security.debian.org|${APT_MIRROR}|g" \
/etc/apt/sources.list; \
fi; \
fi
# Optional PyPI mirror (pip reads these env vars)
ENV PIP_INDEX_URL=${PIP_INDEX_URL}
ENV PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}
WORKDIR /app
# Install dependencies