Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
@@ -2,25 +2,27 @@ FROM python:3.10
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
#
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
-
libgl1 \
|
8 |
-
|
9 |
-
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
#
|
12 |
RUN pip install --upgrade pip
|
13 |
|
14 |
-
# Install
|
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
|
19 |
-
COPY requirements.txt
|
20 |
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
-
# Copy
|
23 |
COPY app.py .
|
24 |
|
25 |
EXPOSE 5000
|
|
|
26 |
CMD ["python", "app.py"]
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
+
libgl1 libglib2.0-0 libsm6 libxext6 libxrender-dev && \
|
8 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
9 |
|
10 |
+
# Upgrade pip
|
11 |
RUN pip install --upgrade pip
|
12 |
|
13 |
+
# Install NumPy first to ensure it's available before torch
|
14 |
+
RUN pip install numpy==1.24.4
|
15 |
+
|
16 |
+
# Install PyTorch CPU version
|
17 |
RUN pip install torch==2.0.1+cpu torchvision==0.15.2+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
18 |
|
19 |
+
# Copy and install requirements
|
20 |
+
COPY requirements.txt .
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Copy app
|
24 |
COPY app.py .
|
25 |
|
26 |
EXPOSE 5000
|
27 |
+
|
28 |
CMD ["python", "app.py"]
|