2026-03-20 17:31:23 +03:30
|
|
|
FROM docker.iranserver.com/python:3.10
|
2026-02-19 17:54:50 +03:30
|
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-03-20 17:31:23 +03:30
|
|
|
# Debian/debian mirrors for apt
|
|
|
|
|
RUN rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* && \
|
|
|
|
|
printf '%s\n' \
|
|
|
|
|
'deb https://mirror-linux.runflare.com/debian/ bookworm main contrib non-free non-free-firmware' \
|
|
|
|
|
'deb https://mirror-linux.runflare.com/debian/ bookworm-updates main contrib non-free non-free-firmware' \
|
|
|
|
|
'deb https://mirror-linux.runflare.com/debian-security/ bookworm-security main contrib non-free non-free-firmware' \
|
|
|
|
|
'' \
|
|
|
|
|
'deb [trusted=yes] https://mirror2.chabokan.net/debian bookworm main contrib non-free non-free-firmware' \
|
|
|
|
|
'deb [trusted=yes] https://mirror2.chabokan.net/debian-security bookworm-security main contrib non-free non-free-firmware' \
|
|
|
|
|
'' \
|
|
|
|
|
'deb http://mirror.iranserver.com/debian/ bookworm main contrib non-free non-free-firmware' \
|
|
|
|
|
'deb-src http://mirror.iranserver.com/debian/ bookworm main contrib non-free non-free-firmware' \
|
|
|
|
|
> /etc/apt/sources.list
|
2026-03-19 23:16:35 +03:30
|
|
|
|
2026-02-19 17:54:50 +03:30
|
|
|
# System deps for MySQL client (pkg-config required by mysqlclient to find libs)
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
default-libmysqlclient-dev \
|
|
|
|
|
build-essential \
|
|
|
|
|
pkg-config \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt .
|
2026-03-19 23:16:35 +03:30
|
|
|
|
|
|
|
|
# Python mirrors
|
|
|
|
|
RUN pip config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple && \
|
|
|
|
|
pip config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple && \
|
2026-03-20 17:31:23 +03:30
|
|
|
pip config --user set global.extra-index-url https://mirror2.chabokan.net/pypi/simple && \
|
2026-03-19 23:16:35 +03:30
|
|
|
pip config --user set global.trusted-host package-mirror.liara.ir && \
|
|
|
|
|
pip config --user set global.trusted-host mirror.cdn.ir && \
|
|
|
|
|
pip config --user set global.trusted-host mirror-pypi.runflare.com
|
|
|
|
|
|
2026-03-20 17:31:23 +03:30
|
|
|
RUN pip install -r requirements.txt
|
2026-02-19 17:54:50 +03:30
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
|
|
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"]
|