This commit is contained in:
Getlles
2026-11-09 17:34:11 +03:00
parent ec540a1a72
commit a592b519ee
13 changed files with 1042 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
FROM python:3.11.7-slim-bookworm AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
FROM python:3.11.7-slim-bookworm AS runner
RUN useradd -u 10001 -m appuser
WORKDIR /home/appuser
COPY --from=builder /install /usr/local
COPY app.py .
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready')"
ENV PYTHONUNBUFFERED=1
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "10"]