lab3: Compose+Nginx, две API-реплики и идемпотентность

This commit is contained in:
2026-11-11 22:14:42 +03:00
parent 0ab3a341aa
commit d4adcce4ff
26 changed files with 1409 additions and 20 deletions
+20
View File
@@ -0,0 +1,20 @@
FROM python:3.12.8-slim-bookworm
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY migrations/ ./migrations/
COPY src/ ./src/
COPY scripts/migrate.py ./scripts/migrate.py
ENV PYTHONPATH=/app/src
ENV APP_HOST=0.0.0.0
ENV APP_PORT=8080
ENV APP_ENV=lab
ENV SESSION_TTL_SECONDS=3600
EXPOSE 8080
CMD ["sh", "-c", "exec uvicorn messenger.app:app --host ${APP_HOST} --port ${APP_PORT}"]