fffiloni commited on
Commit
b1d0e38
·
verified ·
1 Parent(s): f8a5957

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -5
Dockerfile CHANGED
@@ -4,6 +4,24 @@ FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
4
  # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  git \
@@ -21,9 +39,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
21
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
22
  RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
23
 
24
- # Create a working directory
25
- WORKDIR /app
26
-
27
  # Clone the repository (adjust the URL if needed)
28
  RUN git clone --recursive https://github.com/jnjaby/KEEP.git .
29
 
@@ -44,8 +59,9 @@ RUN pip install dlib ffmpeg-python
44
  # Initialize and update Git submodules (if not handled by the clone command)
45
  RUN git submodule init && git submodule update
46
 
47
- # Expose any required ports (if your app uses any)
48
- # EXPOSE 8000
 
49
 
50
  # Command to run your application
51
  CMD ["python", "app.py"]
 
4
  # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ RUN useradd -m -u 1000 user
8
+
9
+ USER user
10
+
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH \
13
+ PYTHONPATH=$HOME/app \
14
+ PYTHONUNBUFFERED=1 \
15
+ GRADIO_ALLOW_FLAGGING=never \
16
+ GRADIO_NUM_PORTS=1 \
17
+ GRADIO_SERVER_NAME=0.0.0.0 \
18
+ GRADIO_THEME=huggingface \
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
26
  RUN apt-get update && apt-get install -y --no-install-recommends \
27
  git \
 
39
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
40
  RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
41
 
 
 
 
42
  # Clone the repository (adjust the URL if needed)
43
  RUN git clone --recursive https://github.com/jnjaby/KEEP.git .
44
 
 
59
  # Initialize and update Git submodules (if not handled by the clone command)
60
  RUN git submodule init && git submodule update
61
 
62
+ # Set the environment variable to specify the GPU device
63
+ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
64
+ ENV CUDA_VISIBLE_DEVICES=0
65
 
66
  # Command to run your application
67
  CMD ["python", "app.py"]