KevinX-Penn28 commited on
Commit
756f2ad
·
verified ·
1 Parent(s): f7ed84e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -23
Dockerfile CHANGED
@@ -1,40 +1,35 @@
1
  FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04
2
 
3
- RUN useradd -m -u 1000 user
4
- # System depsFROM pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel
5
-
6
- RUN apt update && apt upgrade -y
7
- RUN apt-get -y install software-properties-common
8
- RUN add-apt-repository -y ppa:fish-shell/release-4
9
- RUN apt-get -y install git fish tmux
10
 
11
- RUN apt-get -y install curl
12
- RUN apt-get install -y ffmpeg
 
 
13
 
14
- RUN apt-get install -y libgl1-mesa-glx
15
- RUN apt-get install -y libglib2.0-0
16
- RUN apt-get install -y build-essential
17
- RUN apt-get install -y ninja-build
18
- RUN apt-get install -y python3.10-venv
19
 
20
- ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface
21
- RUN mkdir -p /home/user/.cache/huggingface
22
  ENV OMP_NUM_THREADS=1
 
 
23
 
24
  # Create virtualenv
25
- RUN python3 -m venv /opt/venv
26
- ENV PATH="/opt/venv/bin:$PATH"
27
 
 
28
  COPY --chown=user requirements.txt .
29
  RUN pip install --upgrade pip && \
30
  pip install --no-cache-dir -r requirements.txt
31
 
32
- # Copy rest of app source
33
  COPY --chown=user . .
34
 
35
- # Switch to non-root
36
- USER user
37
-
38
  EXPOSE 7860
39
-
40
  CMD ["python3", "app.py"]
 
1
  FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04
2
 
3
+ RUN apt update && apt install -y \
4
+ git fish tmux curl ffmpeg \
5
+ libgl1-mesa-glx libglib2.0-0 \
6
+ build-essential ninja-build python3.10-venv
 
 
 
7
 
8
+ # Create user
9
+ RUN useradd -m -u 1000 user
10
+ USER user
11
+ WORKDIR /home/user
12
 
13
+ # Create HF cache with correct ownership
14
+ ENV HF_HOME=/home/user/.cache/huggingface
15
+ RUN mkdir -p $HF_HOME
 
 
16
 
17
+ # Thread settings
 
18
  ENV OMP_NUM_THREADS=1
19
+ ENV MKL_NUM_THREADS=1
20
+ ENV NUMEXPR_NUM_THREADS=1
21
 
22
  # Create virtualenv
23
+ RUN python3 -m venv /home/user/venv
24
+ ENV PATH="/home/user/venv/bin:$PATH"
25
 
26
+ # Dependencies
27
  COPY --chown=user requirements.txt .
28
  RUN pip install --upgrade pip && \
29
  pip install --no-cache-dir -r requirements.txt
30
 
31
+ # Copy app
32
  COPY --chown=user . .
33
 
 
 
 
34
  EXPOSE 7860
 
35
  CMD ["python3", "app.py"]