Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -7,28 +7,29 @@ WORKDIR /app
|
|
| 7 |
# Copy requirements
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
RUN pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cpu
|
| 13 |
|
| 14 |
-
#
|
| 15 |
RUN pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.1.2+cpu.html
|
| 16 |
|
| 17 |
-
#
|
| 18 |
RUN pip install torch-geometric
|
| 19 |
|
| 20 |
-
#
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
-
# -------------------------------
|
| 23 |
|
| 24 |
# Copy the rest of the app
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
-
# Fix permissions
|
| 28 |
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 29 |
|
| 30 |
-
# Expose
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
-
#
|
| 34 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 7 |
# Copy requirements
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# 1. Install specific NumPy version FIRST to prevent conflicts
|
| 11 |
+
RUN pip install "numpy<2.0.0"
|
| 12 |
+
|
| 13 |
+
# 2. Install Torch 2.1.2 (Stable CPU version)
|
| 14 |
RUN pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cpu
|
| 15 |
|
| 16 |
+
# 3. Install PyTorch Geometric Dependencies (Matching Torch 2.1.2)
|
| 17 |
RUN pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.1.2+cpu.html
|
| 18 |
|
| 19 |
+
# 4. Install PyTorch Geometric
|
| 20 |
RUN pip install torch-geometric
|
| 21 |
|
| 22 |
+
# 5. Install the rest (FastAPI, scikit-learn, etc.)
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 24 |
|
| 25 |
# Copy the rest of the app
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
+
# Fix permissions
|
| 29 |
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 30 |
|
| 31 |
+
# Expose port
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
# Run
|
| 35 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|