Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +27 -20
Dockerfile
CHANGED
@@ -1,9 +1,23 @@
|
|
1 |
-
|
2 |
-
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
|
3 |
|
4 |
# Set environment variables
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
RUN useradd -m -u 1000 user
|
8 |
|
9 |
USER user
|
@@ -19,23 +33,21 @@ ENV HOME=/home/user \
|
|
19 |
GRADIO_SHARE=False \
|
20 |
SYSTEM=spaces
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# Set the working directory to the user's home directory
|
23 |
WORKDIR $HOME/app
|
24 |
|
25 |
# Install system dependencies as root
|
26 |
USER root
|
27 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
28 |
-
git \
|
29 |
-
cmake \
|
30 |
-
build-essential \
|
31 |
-
libgl1-mesa-glx \
|
32 |
-
libglib2.0-0 \
|
33 |
-
ffmpeg \
|
34 |
-
python3.8 \
|
35 |
-
python3-pip \
|
36 |
-
python3.8-dev \
|
37 |
-
&& rm -rf /var/lib/apt/lists/*
|
38 |
-
|
39 |
|
40 |
# Set Python 3.8 as the default python and pip versions
|
41 |
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
@@ -43,7 +55,7 @@ RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
|
|
43 |
|
44 |
USER user
|
45 |
# Clone the repository (adjust the URL if needed)
|
46 |
-
RUN git clone --recursive https://github.com/jnjaby/KEEP.git
|
47 |
|
48 |
# Copy the app.py script into the container
|
49 |
COPY app.py .
|
@@ -64,10 +76,5 @@ USER user
|
|
64 |
RUN pip install ffmpeg-python
|
65 |
RUN pip install dlib
|
66 |
|
67 |
-
# Set the environment variable to specify the GPU device
|
68 |
-
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
69 |
-
ENV CUDA_VISIBLE_DEVICES=0
|
70 |
-
|
71 |
-
|
72 |
# Command to run your application
|
73 |
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
|
|
|
2 |
|
3 |
# Set environment variables
|
4 |
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
|
6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
7 |
+
git \
|
8 |
+
cmake \
|
9 |
+
build-essential \
|
10 |
+
libgl1-mesa-glx \
|
11 |
+
libglib2.0-0 \
|
12 |
+
ffmpeg \
|
13 |
+
python3.8 \
|
14 |
+
python3-pip \
|
15 |
+
python3.8-dev \
|
16 |
+
&& rm -rf /var/lib/apt/lists/*
|
17 |
+
|
18 |
+
# Create a symlink for python
|
19 |
+
RUN ln -s /usr/bin/python3 /usr/bin/python
|
20 |
+
|
21 |
RUN useradd -m -u 1000 user
|
22 |
|
23 |
USER user
|
|
|
33 |
GRADIO_SHARE=False \
|
34 |
SYSTEM=spaces
|
35 |
|
36 |
+
# Set CUDA_HOME environment variable
|
37 |
+
ENV CUDA_HOME=/usr/local/cuda-11.8
|
38 |
+
ENV TORCH_CUDA_ARCH_LIST="6.0;6.1;7.0;7.5;8.0;8.6+PTX;8.9;9.0"
|
39 |
+
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
40 |
+
|
41 |
+
# Set the environment variable to specify the GPU device
|
42 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
43 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
44 |
+
|
45 |
+
|
46 |
# Set the working directory to the user's home directory
|
47 |
WORKDIR $HOME/app
|
48 |
|
49 |
# Install system dependencies as root
|
50 |
USER root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
# Set Python 3.8 as the default python and pip versions
|
53 |
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
|
|
|
55 |
|
56 |
USER user
|
57 |
# Clone the repository (adjust the URL if needed)
|
58 |
+
RUN git clone --recursive https://github.com/jnjaby/KEEP.git $HOME/app
|
59 |
|
60 |
# Copy the app.py script into the container
|
61 |
COPY app.py .
|
|
|
76 |
RUN pip install ffmpeg-python
|
77 |
RUN pip install dlib
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
# Command to run your application
|
80 |
CMD ["python", "app.py"]
|