Update Dockerfile

This commit is contained in:
2026-06-04 13:26:57 +00:00
parent 9608342428
commit e9d67930cc
+20 -22
View File
@@ -1,27 +1,25 @@
FROM python:3.12-slim-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
util-linux \
ca-certificates \
ARG http_proxy
ARG https_proxy
ARG no_proxy
ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
ENV no_proxy=${no_proxy}
# تنظیم proxy برای apt
RUN echo "Acquire::http::Proxy \"$http_proxy\";" > /etc/apt/apt.conf.d/99proxy && \
echo "Acquire::https::Proxy \"$https_proxy\";" >> /etc/apt/apt.conf.d/99proxy
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
util-linux \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# حذف proxy بعد از نصب
RUN rm -f /etc/apt/apt.conf.d/99proxy
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /app/data
ENV HOST_ROOT=/host
ENV DATA_DIR=/app/data
ENV PYTHONUNBUFFERED=1
EXPOSE 8765
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8765/login')" || exit 1
CMD ["gunicorn", "-b", "0.0.0.0:8765", "-w", "2", "--timeout", "180", "run:app"]
# ادامه دستورات خودت...