lab2 complete

This commit is contained in:
kuruoni
2026-11-14 04:50:02 +03:00
parent 65003b6119
commit 684d00c899
20 changed files with 796 additions and 16 deletions
+29
View File
@@ -0,0 +1,29 @@
FROM python:3.11.8-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
RUN groupadd -r appgroup && useradd -r -u 1000 -g appgroup appuser
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN chown -R appuser:appgroup /app
USER appuser
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready')" || exit 1
EXPOSE 8080
CMD ["uvicorn", "api.app:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "10"]