dfae55980a
Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
# پروکسی فقط برای مرحله build (دسترسی به PyPI و APT از طریق VPN سرور)
|
|
ENV http_proxy=http://172.17.0.1:1081
|
|
ENV https_proxy=http://172.17.0.1:1081
|
|
ENV HTTP_PROXY=http://172.17.0.1:1081
|
|
ENV HTTPS_PROXY=http://172.17.0.1:1081
|
|
ENV no_proxy=localhost,127.0.0.1,172.17.0.1
|
|
ENV NO_PROXY=localhost,127.0.0.1,172.17.0.1
|
|
|
|
RUN echo 'Acquire::http::Proxy "http://172.17.0.1:1081";' > /etc/apt/apt.conf.d/99proxy && \
|
|
echo 'Acquire::https::Proxy "http://172.17.0.1:1081";' >> /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
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
RUN mkdir -p /app/data
|
|
|
|
# حذف پروکسی برای runtime — برنامه مستقیم به میرورها وصل میشود
|
|
RUN rm -f /etc/apt/apt.conf.d/99proxy
|
|
ENV http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY=
|
|
|
|
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 ["python", "main.py"]
|