Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +41 -0
Dockerfile
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.11 base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /home/user/app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
git-lfs \
|
| 11 |
+
ffmpeg \
|
| 12 |
+
libsm6 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
cmake \
|
| 15 |
+
rsync \
|
| 16 |
+
libgl1 \
|
| 17 |
+
curl \
|
| 18 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 19 |
+
&& git lfs install
|
| 20 |
+
|
| 21 |
+
# Install Node.js 20
|
| 22 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 23 |
+
&& apt-get install -y nodejs \
|
| 24 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 25 |
+
&& apt-get clean
|
| 26 |
+
|
| 27 |
+
# Upgrade pip
|
| 28 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 29 |
+
|
| 30 |
+
# Copy requirements and install Python packages
|
| 31 |
+
COPY --chown=1000:1000 requirements.txt /tmp/requirements.txt
|
| 32 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 33 |
+
|
| 34 |
+
# Copy app files
|
| 35 |
+
COPY --chown=1000:1000 . /home/user/app
|
| 36 |
+
|
| 37 |
+
# Set default user
|
| 38 |
+
USER 1000
|
| 39 |
+
|
| 40 |
+
# Default command
|
| 41 |
+
CMD ["python", "app.py"] # Change to your main script
|