Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -4,6 +4,12 @@ FROM python:3.10
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Copy requirements and install them
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -11,11 +17,11 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 11 |
# Copy the rest of the backend code
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
-
# Create the temp directory and give it permission
|
| 15 |
RUN mkdir -p temp_uploads
|
| 16 |
RUN chmod -R 777 temp_uploads
|
| 17 |
|
| 18 |
-
# Hugging Face
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
# Start the FastAPI server
|
|
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# --- NEW: Install system dependencies for OpenCV ---
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
libgl1-mesa-glx \
|
| 10 |
+
libglib2.0-0 \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
# Copy requirements and install them
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 17 |
# Copy the rest of the backend code
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
+
# Create the temp directory and give it permission
|
| 21 |
RUN mkdir -p temp_uploads
|
| 22 |
RUN chmod -R 777 temp_uploads
|
| 23 |
|
| 24 |
+
# Hugging Face port
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
# Start the FastAPI server
|