схема бд и компоуз с постгресс

This commit is contained in:
2026-10-23 01:32:02 +03:00
parent 65003b6119
commit 17377031cc
6 changed files with 364 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
FROM python:3.11.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py schemas.py ./
# создать непривилегированного пользователя
RUN useradd --create-home --shell /bin/bash appuser
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --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"]