Перенести и адаптировать обязательный минимум лабораторной 6

This commit is contained in:
2026-12-04 06:42:43 +03:00
parent 20afc2c790
commit cb7824c14c
37 changed files with 2292 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
FROM python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
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=2s --timeout=2s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready',timeout=1)"
EXPOSE 8080
CMD ["python", "-m", "src.serve"]