-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 804 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.11-bullseye
## Set working directory
WORKDIR /app
## Install dependencies (including required libraries)
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 build-essential cmake git && rm -rf /var/lib/apt/lists/*
# Copy dependency descriptors
COPY pyproject.toml requirements.txt /app/
# Copy the app
COPY tools /app/tools
# Install Python dependencies without pip cache
RUN pip install --no-cache-dir .
## Create non-root user and set ownership of the working directory
RUN adduser --disabled-password --gecos "" --no-create-home non-root && \
chown -R non-root:non-root /app
## Switch to non-root user
USER non-root
## Set PATH for the installed executable
ENV PATH="/home/non-root/.local/bin:/usr/local/bin:$PATH"
## Define image execution
ENTRYPOINT ["tools"]