fix pip package fallback repo
This commit is contained in:
1 parent
05480970d0
commit
f4fa16d9e7
1 file changed
+11
-3
+11
-3
@@ -3,8 +3,14 @@ FROM python:3.12-slim AS builder
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_INDEX_URL=https://package-mirror.liara.ir/repository/pypi/simple
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
# Configure PyPI index with official PyPI as fallback
|
||||
ARG PIP_INDEX_URL=https://package-mirror.liara.ir/repository/pypi/simple
|
||||
ARG PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
||||
ENV PIP_INDEX_URL=${PIP_INDEX_URL} \
|
||||
PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Liara mirrors Debian and PyPI traffic inside Iran. The Debian mirror is a
|
||||
@@ -15,8 +21,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN python -m venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install --default-timeout=1000 -r requirements.txt
|
||||
@@ -43,4 +51,4 @@ RUN chmod +x /app/docker/entrypoint.sh
|
||||
USER django
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["/app/docker/entrypoint.sh"]
|
||||
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--timeout", "60", "--graceful-timeout", "30", "--access-logfile", "-", "--error-logfile", "-"]
|
||||
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--timeout", "60", "--graceful-timeout", "30", "--access-logfile", "-", "--error-logfile", "-"]
|
||||
Reference in new issue
Block a user