oceansweep commited on
Commit
452a5dc
1 Parent(s): c1944d4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -33
Dockerfile CHANGED
@@ -2,8 +2,28 @@ FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu22.04
2
 
3
  ARG DEBIAN_FRONTEND=noninteractive
4
 
5
- ENV PYTHONUNBUFFERED=1
 
 
 
 
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
9
  python3.9 \
@@ -14,47 +34,20 @@ RUN apt-get update && apt-get install -y \
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
- RUN chown -R user:user /app && \
37
- chmod -R 777 /app/*
38
 
39
- # Switch to the "user" user
40
- USER user
41
-
42
- #RUN mount && \
43
- # touch /test_write && \
44
- # echo "File system status:" && \
45
- # df -h
46
-
47
-
48
-
49
- # Set environment variables
50
- ENV PYTHONUNBUFFERED=1 \
51
- GRADIO_ALLOW_FLAGGING=never \
52
- GRADIO_NUM_PORTS=1 \
53
- GRADIO_SERVER_NAME=0.0.0.0 \
54
- GRADIO_THEME=huggingface \
55
- SYSTEM=spaces \
56
- TRANSFORMERS_CACHE=/dev/shm \
57
- GRADIO_ANALYTICS_ENABLED=False
58
 
59
  RUN whoami && \
60
  echo "Permissions for /app:" && \
 
2
 
3
  ARG DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Set up a new user named "user" with user ID 1099
6
+ RUN useradd -m -u 1099 user
7
+
8
+ # Switch to the "user" user
9
+ USER user
10
 
11
+ # Set home to the user's home directory
12
+ ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
+
15
+ # Set environment variables
16
+ ENV PYTHONUNBUFFERED=1 \
17
+ GRADIO_ALLOW_FLAGGING=never \
18
+ GRADIO_NUM_PORTS=1 \
19
+ GRADIO_SERVER_NAME=0.0.0.0 \
20
+ GRADIO_THEME=huggingface \
21
+ SYSTEM=spaces \
22
+ TRANSFORMERS_CACHE=/dev/shm \
23
+ GRADIO_ANALYTICS_ENABLED=False
24
+ WORKDIR /app
25
+
26
+ # Update packages
27
  RUN apt-get update && apt-get install -y \
28
  build-essential \
29
  python3.9 \
 
34
  libcudnn8-dev \
35
  sudo
36
 
 
 
 
 
 
 
 
37
  # Set up CUDA libraries
38
  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
39
 
40
+ COPY ./requirements.txt /app/requirements.txt
41
+
42
  RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
43
 
44
  # Copy the current directory contents into the container at /app
45
+ COPY --chown=user . $HOME/app
46
 
47
  # Create necessary directories and set permissions
48
+ RUN mkdir -p /app/Results/Audio_Processing /app/Results/Video_Downloads
 
 
 
 
49
 
50
+ RUN chmod -R 777 /app/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  RUN whoami && \
53
  echo "Permissions for /app:" && \