Files

16 lines
575 B
Docker

FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /srv
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY pytest.ini .
COPY app ./app
COPY site ./site
COPY tests ./tests
# run as an ordinary user (uid 1000); /work must be writable by it
RUN useradd --uid 1000 --no-create-home --shell /usr/sbin/nologin app && mkdir /work && chown app:app /work
USER app
ENV WORK_DIR=/work TMPDIR=/work
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]