lab3_and_3grade

This commit is contained in:
caramelteawithmint
2026-11-13 18:01:54 +03:00
parent ec540a1a72
commit 09e26c3c5a
28 changed files with 1494 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
# Копируем код приложения, миграции и скрипты
COPY src/app ./app
COPY src/migrations ./migrations
COPY scripts ./scripts
# не root
RUN useradd --create-home --shell /bin/bash appuser \
&& chown -R appuser:appuser /app
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=2s --start-period=10s --retries=6 \
CMD curl -fsS http://127.0.0.1:8080/health/live || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--proxy-headers", "--forwarded-allow-ips", "*"]