Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
@@ -1,23 +1,22 @@
|
|
1 |
-
FROM python:3.10
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
#
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
libgl1 \
|
8 |
libglib2.0-0 \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
|
14 |
-
# Step 1: install numpy first to avoid torch import error
|
15 |
-
RUN pip install --no-cache-dir numpy
|
16 |
|
17 |
-
#
|
18 |
-
RUN pip install
|
|
|
19 |
|
20 |
-
#
|
|
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
# Copy application code
|
|
|
1 |
+
FROM python:3.10
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# System dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
libgl1 \
|
8 |
libglib2.0-0 \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
# Ensure pip is up to date
|
12 |
+
RUN pip install --upgrade pip
|
|
|
|
|
|
|
13 |
|
14 |
+
# Install numpy first, then torch/torchvision (CPU)
|
15 |
+
RUN pip install numpy
|
16 |
+
RUN pip install torch==2.0.1+cpu torchvision==0.15.2+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
17 |
|
18 |
+
# Copy requirements and install the rest
|
19 |
+
COPY requirements.txt ./
|
20 |
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
# Copy application code
|