oceansweep commited on
Commit
d8f7751
1 Parent(s): d6bd8f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -29
Dockerfile CHANGED
@@ -14,39 +14,35 @@ RUN apt-get update && apt-get install -y \
14
  libcudnn8-dev \
15
  sudo
16
 
17
- RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
 
18
 
19
-
20
- WORKDIR /code
21
 
22
- COPY ./requirements.txt /code/requirements.txt
23
 
24
- # make sure cudnn errors go away
25
- #RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`python3 -c 'import os; import torch; print(os.path.dirname(torch.__file__) +"/lib")'`
26
  RUN export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; import torch; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__) + ":" + os.path.dirname(torch.__file__) +"/lib")'`:$LD_LIBRARY_PATH
27
 
28
- # Set up a new user named "user" with user ID 1000
29
- RUN useradd -m -u 1099 user
 
 
 
 
 
 
 
30
  # Switch to the "user" user
31
- #USER user
32
- # Set home to the user's home directory
33
- ENV PYTHONUNBUFFERED=1 \
34
- GRADIO_ALLOW_FLAGGING=never \
35
- GRADIO_NUM_PORTS=1 \
36
- GRADIO_SERVER_NAME=0.0.0.0 \
37
- GRADIO_THEME=huggingface \
38
- SYSTEM=spaces
39
 
40
- RUN export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; import torch; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__) + ":" + os.path.dirname(torch.__file__) +"/lib")'`:$LD_LIBRARY_PATH
41
- RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
42
-
43
- # Set the working directory to the user's home directory
44
- WORKDIR $HOME/app
45
-
46
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
47
- COPY --chown=$USER . $HOME/app
48
- CMD ["mkdir", "./Results"]
49
- CMD ["mkdir", "./Results/Audio_Processing"]
50
- CMD ["mkdir", "./Results/Video_Downloads"]
51
- CMD ["chmod", "-R", "775", "$HOME/"]
52
- CMD ["python3", "app.py"]
 
14
  libcudnn8-dev \
15
  sudo
16
 
17
+ # Set up a new user named "user" with user ID 1099
18
+ RUN useradd -m -u 1099 user
19
 
20
+ WORKDIR /app
 
21
 
22
+ COPY ./requirements.txt /app/requirements.txt
23
 
24
+ # Set up CUDA libraries
 
25
  RUN export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; import torch; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__) + ":" + os.path.dirname(torch.__file__) +"/lib")'`:$LD_LIBRARY_PATH
26
 
27
+ RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
28
+
29
+ # Copy the current directory contents into the container at /app
30
+ COPY . /app
31
+
32
+ # Create necessary directories and set permissions
33
+ RUN mkdir -p /app/Results/Audio_Processing /app/Results/Video_Downloads && \
34
+ chown -R user:user /app
35
+
36
  # Switch to the "user" user
37
+ USER user
 
 
 
 
 
 
 
38
 
39
+ # Set environment variables
40
+ ENV PYTHONUNBUFFERED=1 \
41
+ GRADIO_ALLOW_FLAGGING=never \
42
+ GRADIO_NUM_PORTS=1 \
43
+ GRADIO_SERVER_NAME=0.0.0.0 \
44
+ GRADIO_THEME=huggingface \
45
+ SYSTEM=spaces
46
+
47
+ # Command to run the application
48
+ CMD ["python3", "app.py"]