lab2
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-13 20:42:10 +03:00
parent 17377031cc
commit 3ed1c4e5b6
29 changed files with 2141 additions and 244 deletions
+6 -4
View File
@@ -5,15 +5,17 @@ WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py schemas.py ./
COPY app.py schemas.py db.py cache.py ./
COPY migrations ./migrations
# создать непривилегированного пользователя
# непривилегированный пользователь
RUN useradd --create-home --shell /bin/bash appuser
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready').read()" || exit 1
CMD ["sh", "-c", "exec uvicorn app:app --host 0.0.0.0 --port 8080"]
# exec: uvicorn — PID 1, получает SIGTERM и корректно закрывает пул соединений
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]