Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
#
|
2 |
-
FROM
|
3 |
|
4 |
# Set up the environment
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
-
# Install
|
9 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
10 |
|
11 |
# Set the working directory
|
12 |
WORKDIR /app
|
13 |
|
14 |
# Set a writable cache directory
|
15 |
ENV HF_HOME=/app/cache
|
16 |
-
|
17 |
-
# Create the cache directory
|
18 |
RUN mkdir -p /app/cache && chmod 777 /app/cache
|
19 |
|
20 |
-
# Install
|
21 |
-
RUN
|
22 |
|
23 |
-
# Copy and install the rest of the
|
24 |
COPY requirements.txt .
|
25 |
-
RUN
|
26 |
|
27 |
# Copy your main application code
|
28 |
COPY main.py .
|
29 |
|
30 |
-
# Expose the port
|
31 |
EXPOSE 8000
|
32 |
|
33 |
# The command to start the Uvicorn server
|
|
|
1 |
+
# Use the CUDA 11.8 base image that we know works
|
2 |
+
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
3 |
|
4 |
# Set up the environment
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
+
# Install Python 3.10
|
9 |
+
RUN apt-get update && apt-get install -y \
|
10 |
+
python3.10 python3-pip libgl1-mesa-glx \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# Set the working directory
|
14 |
WORKDIR /app
|
15 |
|
16 |
# Set a writable cache directory
|
17 |
ENV HF_HOME=/app/cache
|
|
|
|
|
18 |
RUN mkdir -p /app/cache && chmod 777 /app/cache
|
19 |
|
20 |
+
# Install the exact, known-good version of PyTorch for CUDA 11.8
|
21 |
+
RUN pip3 install torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
|
22 |
|
23 |
+
# Copy and install the rest of the dependencies
|
24 |
COPY requirements.txt .
|
25 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
# Copy your main application code
|
28 |
COPY main.py .
|
29 |
|
30 |
+
# Expose the port
|
31 |
EXPOSE 8000
|
32 |
|
33 |
# The command to start the Uvicorn server
|