forked from mtusi2026/mtusi2026lab3
New Commit
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
ENV PYTHONPATH=/app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
make \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
|
||||
|
||||
COPY requirements.txt requirements-dev.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
|
||||
|
||||
COPY src/ ./src/
|
||||
COPY alembic.ini ./
|
||||
COPY alembic/ ./alembic/
|
||||
COPY tests/ ./tests/
|
||||
COPY scripts/ ./scripts/
|
||||
COPY contracts/ ./contracts/
|
||||
COPY Makefile lab.json ./
|
||||
|
||||
RUN chown -R appuser:appgroup /app
|
||||
|
||||
USER appuser
|
||||
|
||||
# Exec-форма: uvicorn получает SIGTERM, перестаёт принимать новые соединения
|
||||
# и ждёт завершения текущих запросов до 10 секунд. Один воркер на контейнер.
|
||||
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080", \
|
||||
"--workers", "1", "--timeout-graceful-shutdown", "10"]
|
||||
Reference in New Issue
Block a user