forked from mtusi2026/mtusi2026lab2
30 lines
724 B
Docker
30 lines
724 B
Docker
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-форма для корректного получения SIGTERM
|
|
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080"]
|