Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -9
Dockerfile
CHANGED
|
@@ -12,18 +12,14 @@ RUN apt-get update && apt-get install -y \
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# ----------------------------------------------------------------------
|
| 15 |
-
# CRITICAL FIX 1:
|
|
|
|
|
|
|
| 16 |
# ----------------------------------------------------------------------
|
| 17 |
|
| 18 |
-
# 1a. Copy requirements and install the pinned NumPy version first
|
| 19 |
COPY requirements.txt ./
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
# 1b. Force re-install PyTorch to link it correctly with the new NumPy 1.24.4 version
|
| 23 |
-
RUN pip install --no-cache-dir torch
|
| 24 |
-
|
| 25 |
-
# 1c. Install remaining Python packages from requirements
|
| 26 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
# ----------------------------------------------------------------------
|
| 29 |
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# ----------------------------------------------------------------------
|
| 15 |
+
# CRITICAL FIX 1: Single, aggressive install step
|
| 16 |
+
# We rely on the base image for PyTorch and force all requirements
|
| 17 |
+
# including the pinned NumPy, to be installed in one go.
|
| 18 |
# ----------------------------------------------------------------------
|
| 19 |
|
|
|
|
| 20 |
COPY requirements.txt ./
|
| 21 |
+
# The --upgrade and --force-reinstall flags fix fragmentation errors
|
| 22 |
+
RUN pip install --no-cache-dir --upgrade --force-reinstall -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# ----------------------------------------------------------------------
|
| 25 |
|