From 596e2716abe670720386d29123fd0d268a383a69 Mon Sep 17 00:00:00 2001 From: Amirhossein Khalili Date: Wed, 29 Apr 2026 15:58:06 +0330 Subject: [PATCH] build(deploy): update backend image dependencies --- backend/Dockerfile | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 45f9d2d..b127b6e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,25 +1,34 @@ -FROM python:3.14-slim +FROM python:3.14 WORKDIR /app ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 -ENV PIP_INDEX_URL=https://package-mirror.liara.ir/repository/pypi/simple -# Adapted Runflare mirror for Debian-based official Python image -RUN . /etc/os-release && \ - echo "deb http://mirror-linux.runflare.com/debian $VERSION_CODENAME main" > /etc/apt/sources.list && \ - echo "deb http://mirror-linux.runflare.com/debian $VERSION_CODENAME-updates main" >> /etc/apt/sources.list && \ - echo "deb http://mirror-linux.runflare.com/debian-security $VERSION_CODENAME-security main" >> /etc/apt/sources.list +# ---- APT Iran-safe configuration ---- +RUN rm -f /etc/apt/sources.list.d/debian.sources && \ + printf '%s\n' \ + 'deb http://mirror.arvancloud.ir/debian trixie main contrib non-free non-free-firmware' \ + 'deb http://mirror.arvancloud.ir/debian trixie-updates main contrib non-free non-free-firmware' \ + 'deb http://mirror.arvancloud.ir/debian-security trixie-security main contrib non-free non-free-firmware' \ + > /etc/apt/sources.list && \ + echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid RUN apt-get update \ - && apt-get install -y gcc libpq-dev \ + && apt-get install -y --no-install-recommends \ + gcc \ + libpq-dev \ + rustc \ + cargo \ + pkg-config \ && rm -rf /var/lib/apt/lists/* -COPY requirements/ /app/requirements/ -RUN pip install --no-cache-dir -r requirements/base.txt \ - && pip install --no-cache-dir -r requirements/prod.txt - -COPY . . - -CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"] +COPY requirements/ /app/requirements/ + +RUN pip install --no-cache-dir --upgrade pip setuptools wheel \ + && pip install --no-cache-dir -r requirements/base.txt \ + && pip install --no-cache-dir -r requirements/prod.txt + +COPY . . + +CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"] \ No newline at end of file