lab3: nginx, replicas, idempotency, tests

This commit is contained in:
2026-11-06 17:23:38 +03:00
commit 46c829b730
96 changed files with 206384 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM python:3.13-slim
WORKDIR /app
COPY requirements-dev.txt .
RUN pip install --no-cache-dir -r requirements-dev.txt
RUN useradd --create-home --shell /bin/bash appuser
COPY app/ app/
COPY alembic.ini .
COPY alembic/ alembic/
RUN chown -R appuser:appuser /app/alembic
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/live')" || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "10", "--reload"]