lab3: 2 API replicas behind nginx LB, idempotency, X-Instance-Id

This commit is contained in:
2026-11-16 21:54:29 +03:00
parent 0ab3a341aa
commit fbe686f521
23 changed files with 727 additions and 14 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM python:3.12-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY migrations ./migrations
COPY src ./src
RUN useradd -m app && chown -R app /app
USER app
EXPOSE 8080
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080"]