forked from mtusi2026/mtusi2026lab2
Лаба 2: PostgreSQL-хранилище и Redis-сессии (оценка 4)
FastAPI + asyncpg + Redis/argon2id. Пользователи/чаты/участники/сообщения в Postgres с версионируемой миграцией и keyset-пагинацией. Basic-вход, Bearer-сессии в Redis с TTL и AOF-персистентностью. make check/test/ test-persistence/validate зелёные; evidence по EXPLAIN ANALYZE, короткому TTL и падению Redis приложены в REPORT.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
FROM python:3.12.7-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY app ./app
|
||||
COPY migrations ./migrations
|
||||
|
||||
RUN useradd --create-home --shell /usr/sbin/nologin appuser
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=5 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/live', timeout=2)" || exit 1
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
|
||||
Reference in New Issue
Block a user