Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Use official Python image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libgl1 \
|
| 7 |
libglib2.0-0 \
|
|
@@ -13,12 +13,14 @@ WORKDIR /app
|
|
| 13 |
# Copy your requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
-
# Install dependencies (
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# CRITICAL FIX:
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Copy all your scripts and weights into the container
|
| 24 |
COPY . .
|
|
|
|
| 1 |
# Use official Python image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libgl1 \
|
| 7 |
libglib2.0-0 \
|
|
|
|
| 13 |
# Copy your requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
+
# Install dependencies (Ultralytics will sneakily install the GUI version of OpenCV here)
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# CRITICAL FIX: Wipe out ALL versions of OpenCV so the cv2 folder is completely gone
|
| 20 |
+
RUN pip uninstall -y opencv-python opencv-python-headless
|
| 21 |
+
|
| 22 |
+
# Reinstall strictly the headless version as the final authority
|
| 23 |
+
RUN pip install --no-cache-dir opencv-python-headless
|
| 24 |
|
| 25 |
# Copy all your scripts and weights into the container
|
| 26 |
COPY . .
|