Spaces:
Runtime error
Runtime error
Commit
·
4a2d6e9
1
Parent(s):
e15d492
docker up
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,25 +1,26 @@
|
|
| 1 |
-
# CUDA-enabled base image with
|
| 2 |
FROM nvidia/cuda:11.8.0-base-ubuntu20.04
|
| 3 |
|
| 4 |
# Set environment variables
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
python3.11 python3.11-distutils python3.11-dev python3-pip git wget unzip && \
|
| 11 |
rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Update alternatives to
|
| 14 |
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
|
| 15 |
update-alternatives --config python3
|
| 16 |
|
| 17 |
-
# **Important:** Make pip use Python 3.11
|
| 18 |
-
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 && \
|
| 19 |
-
update-alternatives --config pip
|
| 20 |
-
|
| 21 |
# Upgrade pip to the latest version
|
| 22 |
-
RUN pip install --upgrade pip
|
| 23 |
|
| 24 |
# Set the working directory
|
| 25 |
WORKDIR /app
|
|
@@ -42,4 +43,4 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 42 |
EXPOSE 7860
|
| 43 |
|
| 44 |
# Start the Flask app
|
| 45 |
-
CMD ["python3", "run.py"]
|
|
|
|
| 1 |
+
# CUDA-enabled base image with Ubuntu 20.04
|
| 2 |
FROM nvidia/cuda:11.8.0-base-ubuntu20.04
|
| 3 |
|
| 4 |
# Set environment variables
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
+
# Add deadsnakes PPA for Python 3.11
|
| 9 |
+
RUN apt-get update && apt-get install -y software-properties-common && \
|
| 10 |
+
add-apt-repository -y ppa:deadsnakes/ppa && \
|
| 11 |
+
apt-get update
|
| 12 |
+
|
| 13 |
+
# Install Python 3.11 and required packages
|
| 14 |
+
RUN apt-get install -y \
|
| 15 |
python3.11 python3.11-distutils python3.11-dev python3-pip git wget unzip && \
|
| 16 |
rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
+
# Update alternatives to set Python 3.11 as default
|
| 19 |
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
|
| 20 |
update-alternatives --config python3
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Upgrade pip to the latest version
|
| 23 |
+
RUN python3 -m pip install --upgrade pip
|
| 24 |
|
| 25 |
# Set the working directory
|
| 26 |
WORKDIR /app
|
|
|
|
| 43 |
EXPOSE 7860
|
| 44 |
|
| 45 |
# Start the Flask app
|
| 46 |
+
CMD ["python3", "run.py"]
|