Run container as non-root user; polish Dockerfile
This commit is contained in:
parent
f2d53a573f
commit
7310f86b65
7 changed files with 9 additions and 1 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -1,6 +1,8 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
@ -9,6 +11,12 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p /app/data /app/uploads /app/outputs && \
|
||||
groupadd -r appuser && useradd -r -g appuser appuser && \
|
||||
chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue