Перенести собственную реализацию лабораторной 2 с сохранением контракта лабораторной 3

This commit is contained in:
2026-10-23 18:28:16 +03:00
parent 0ab3a341aa
commit 366b4be7b8
24 changed files with 983 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
FROM python:3.11.10-slim-bookworm
WORKDIR /app
# Приложение работает без прав root.
RUN groupadd -r appuser && useradd -r -g appuser appuser
COPY requirements.lock.txt .
RUN pip install --no-cache-dir -r requirements.lock.txt
COPY src/ src/
COPY migrations/ migrations/
USER appuser
HEALTHCHECK --interval=5s --timeout=5s --start-period=15s --retries=5 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready')"
EXPOSE 8080
CMD ["sh", "-c", "python -m src.migrate && exec python -m uvicorn src.app:app --host 0.0.0.0 --port 8080 --timeout-graceful-shutdown 8"]