25 lines
727 B
Docker
25 lines
727 B
Docker
FROM python:3.12.10-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
APP_HOST=0.0.0.0 \
|
|
APP_PORT=8080
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt requirements.runtime.lock ./
|
|
RUN pip install --no-cache-dir --requirement requirements.runtime.lock \
|
|
&& groupadd --system --gid 10001 app \
|
|
&& useradd --system --uid 10001 --gid app --home-dir /nonexistent --shell /usr/sbin/nologin app
|
|
|
|
COPY --chown=app:app src ./src
|
|
COPY --chown=app:app migrations ./migrations
|
|
COPY --chown=app:app scripts ./scripts
|
|
COPY --chown=app:app student-tests ./student-tests
|
|
COPY --chown=app:app contracts ./contracts
|
|
COPY --chown=app:app lab.json ./lab.json
|
|
|
|
USER 10001:10001
|
|
|
|
CMD ["python", "-m", "src.launch", "api"]
|