Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +28 -13
Dockerfile
CHANGED
|
@@ -1,13 +1,28 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
# Set working directory
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Install system dependencies for OpenCV and other required libraries
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
libgl1 \
|
| 9 |
+
libglib2.0-0 \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Create Uploads, cache, and models directories with writable permissions
|
| 13 |
+
RUN mkdir -p /app/Uploads /app/cache /app/models && chmod -R 777 /app/Uploads /app/cache /app/models
|
| 14 |
+
|
| 15 |
+
# Set HF_HOME for huggingface_hub cache
|
| 16 |
+
ENV HF_HOME=/app/cache
|
| 17 |
+
|
| 18 |
+
# Copy all files and folders from the project root to /app
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
RUN pip install python-multipart
|
| 22 |
+
|
| 23 |
+
# Install Python dependencies from requirements.txt
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# Expose the port for Hugging Face Spaces
|
| 27 |
+
EXPOSE 7860
|
| 28 |
+
CMD ["python", "app.py"]
|