Spaces:
Build error
Build error
Vo Minh Vu commited on
Commit ·
b743811
1
Parent(s): b9f19d3
Update Dockerfile
Browse files- Dockerfile +14 -5
Dockerfile
CHANGED
|
@@ -1,8 +1,17 @@
|
|
| 1 |
-
FROM
|
| 2 |
-
|
| 3 |
-
# Install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
-
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
|
@@ -19,7 +28,7 @@ ENV \
|
|
| 19 |
RUN mkdir -p /app/.cache/{pip,torch,numba} \
|
| 20 |
&& chmod -R 777 /app/.cache
|
| 21 |
|
| 22 |
-
#
|
| 23 |
COPY requirements.txt .
|
| 24 |
RUN pip install --upgrade pip \
|
| 25 |
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# 1) Install CUDA runtime 11.7
|
| 4 |
+
RUN apt-get update && apt-get install -y gnupg curl && \
|
| 5 |
+
curl -s -L https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb \
|
| 6 |
+
-o cuda-keyring.deb && \
|
| 7 |
+
dpkg -i cuda-keyring.deb && \
|
| 8 |
+
apt-get update && \
|
| 9 |
+
apt-get install -y cuda-runtime-11-7 && \
|
| 10 |
+
rm -rf /var/lib/apt/lists/* cuda-keyring.deb
|
| 11 |
+
|
| 12 |
+
# install build/c runtime deps
|
| 13 |
RUN apt-get update && apt-get install -y \
|
| 14 |
+
build-essential python3-dev git \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
WORKDIR /app
|
|
|
|
| 28 |
RUN mkdir -p /app/.cache/{pip,torch,numba} \
|
| 29 |
&& chmod -R 777 /app/.cache
|
| 30 |
|
| 31 |
+
# 2) install ALL your Python deps (including CPU-only torch)
|
| 32 |
COPY requirements.txt .
|
| 33 |
RUN pip install --upgrade pip \
|
| 34 |
&& pip install --no-cache-dir -r requirements.txt
|