Jofthomas HF staff commited on
Commit
559adc3
·
1 Parent(s): 79bb791

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -19
Dockerfile CHANGED
@@ -1,13 +1,21 @@
1
  FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
2
 
 
 
 
3
  # Install Python and other dependencies
4
  RUN apt-get update && apt-get install -y \
5
  python3.10 \
6
  python3-pip \
7
  ffmpeg \
 
8
  && apt-get clean \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
 
 
 
11
  # Set up the working directory
12
  WORKDIR /app
13
 
@@ -22,22 +30,4 @@ RUN useradd -m -u 1000 user
22
  # Set environment variables for the user
23
  ENV HOME=/home/user \
24
  PATH=/home/user/.local/bin:$PATH \
25
- CUDA_HOME=/usr/local/cuda
26
-
27
- # Set the user and working directory
28
- USER user
29
- WORKDIR $HOME/app
30
-
31
- # Copy the application code
32
- COPY --chown=user . $HOME/app
33
-
34
- # Ensure the user has the correct permissions
35
- RUN chmod -R 777 $HOME/app
36
-
37
- # Set additional environment variables
38
- ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/
39
- ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/
40
- ENV PATH="/opt/venv/bin:$PATH"
41
-
42
- # Set the command to run the application
43
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
2
 
3
+ # Set the environment variable to noninteractive to avoid tzdata prompts
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
  # Install Python and other dependencies
7
  RUN apt-get update && apt-get install -y \
8
  python3.10 \
9
  python3-pip \
10
  ffmpeg \
11
+ tzdata \
12
  && apt-get clean \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Configure the timezone (change to your preferred timezone)
16
+ RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
17
+ dpkg-reconfigure --frontend noninteractive tzdata
18
+
19
  # Set up the working directory
20
  WORKDIR /app
21
 
 
30
  # Set environment variables for the user
31
  ENV HOME=/home/user \
32
  PATH=/home/user/.local/bin:$PATH \
33
+ CUDA_HOME=/