Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a stable Debian 12 (Bookworm) base image
|
| 2 |
+
FROM python:3.10-slim-bookworm
|
| 3 |
+
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
# We replace 'libgl1-mesa-glx' (which fails) with 'libgl1' (the correct one)
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
git \
|
| 8 |
+
git-lfs \
|
| 9 |
+
ffmpeg \
|
| 10 |
+
libsm6 \
|
| 11 |
+
libxext6 \
|
| 12 |
+
cmake \
|
| 13 |
+
rsync \
|
| 14 |
+
libgl1 \
|
| 15 |
+
build-essential \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 17 |
+
&& git lfs install
|
| 18 |
+
|
| 19 |
+
# Create a non-root user and set up the app directory
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
USER user
|
| 22 |
+
WORKDIR /home/user/app
|
| 23 |
+
|
| 24 |
+
# Install Python packages
|
| 25 |
+
COPY --chown=1000:1000 requirements.txt .
|
| 26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
+
|
| 28 |
+
# Copy the rest of your application code (app.py, dh3.png, etc.)
|
| 29 |
+
COPY --chown=1000:1000 . .
|
| 30 |
+
|
| 31 |
+
# Set the command to run your app
|
| 32 |
+
CMD ["python", "app.py"]
|