28 lines
632 B
Docker
28 lines
632 B
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
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
|
|
|
|
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"]
|