File size: 795 Bytes
760d9b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
# Use a stable Debian 12 (Bookworm) base image
FROM python:3.10-slim-bookworm

# Install system dependencies
# We replace 'libgl1-mesa-glx' (which fails) with 'libgl1' (the correct one)
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    ffmpeg \
    libsm6 \
    libxext6 \
    cmake \
    rsync \
    libgl1 \
    build-essential \
 && rm -rf /var/lib/apt/lists/* \
 && git lfs install

# Create a non-root user and set up the app directory
RUN useradd -m -u 1000 user
USER user
WORKDIR /home/user/app

# Install Python packages
COPY --chown=1000:1000 requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application code (app.py, dh3.png, etc.)
COPY --chown=1000:1000 . .

# Set the command to run your app
CMD ["python", "app.py"]