Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python 3.10 image as the base
|
| 2 |
+
FROM python:3.10
|
| 3 |
+
|
| 4 |
+
# Install system dependencies required for Hugging Face models and image processing
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
git \
|
| 7 |
+
git-lfs \
|
| 8 |
+
ffmpeg \
|
| 9 |
+
libsm6 \
|
| 10 |
+
libxext6 \
|
| 11 |
+
cmake \
|
| 12 |
+
rsync \
|
| 13 |
+
libgl1-mesa-glx \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Set up Git LFS for model downloads
|
| 17 |
+
RUN git lfs install
|
| 18 |
+
|
| 19 |
+
# Set the working directory
|
| 20 |
+
WORKDIR /home/user/app
|
| 21 |
+
|
| 22 |
+
# Copy the requirements file and install Python dependencies
|
| 23 |
+
COPY requirements.txt /home/user/app/
|
| 24 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 25 |
+
pip install --no-cache-dir -r requirements.txt
|
| 26 |
+
|
| 27 |
+
# Copy application code into the container
|
| 28 |
+
COPY . .
|
| 29 |
+
|
| 30 |
+
# Expose Streamlit's default port (8501) if you're using Streamlit
|
| 31 |
+
EXPOSE 8501
|
| 32 |
+
|
| 33 |
+
# Command to run the app
|
| 34 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.enableCORS=false"]
|