jibsn commited on
Commit
eef5e21
·
verified ·
1 Parent(s): f0262f0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -32
Dockerfile CHANGED
@@ -1,43 +1,26 @@
1
- FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
2
-
3
- #FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
4
-
5
- #ENV TZ=Europe/Berlin
6
- #RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
7
 
8
  RUN apt-get update
9
- #RUN apt install -y tzdata
10
- #RUN apt-get -y update && apt-get -y install software-properties-common \
11
- #&& add-apt-repository ppa:deadsnakes/ppa && apt install -y python3.10
12
-
13
- RUN apt-get install -y python3 python3-pip git wget
14
 
15
- WORKDIR /code
16
 
17
- COPY ./requirements.txt /code/requirements.txt
18
 
19
  RUN python3 -m pip install --upgrade pip
20
 
21
- RUN pip install gradio==3.46.0
22
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
23
-
24
- # Set up a new user named "user" with user ID 1000
25
- RUN useradd -m -u 1000 user
26
-
27
- # Switch to the "user" user
28
- USER user
29
-
30
- # Set home to the user's home directory
31
- ENV HOME=/home/user \
32
- PATH=/home/user/.local/bin:$PATH
33
-
34
- # Set the working directory to the user's home directory
35
- WORKDIR $HOME/app
36
-
37
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
38
- COPY --chown=user . $HOME/app
39
 
40
  EXPOSE 7860
41
  ENV GRADIO_SERVER_NAME="0.0.0.0"
42
 
43
- CMD ["python3", "app.py"]
 
1
+ FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04
 
 
 
 
 
2
 
3
  RUN apt-get update
4
+ RUN apt-get install -y python3 python3-pip git wget nano software-properties-common \
5
+ build-essential \
6
+ && rm -rf /var/lib/apt/lists/*
 
 
7
 
8
+ WORKDIR /app
9
 
10
+ COPY ./req.txt /app/requirements.txt
11
 
12
  RUN python3 -m pip install --upgrade pip
13
 
14
+ RUN pip install --no-cache-dir gradio
15
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
16
+ RUN pip cache purge \
17
+ && apt-get autoremove -y \
18
+ && apt-get autoclean \
19
+ && rm -rf /tmp/* /var/tmp/* \
20
+ && rm -rf /root/.cache/pip \
21
+ && rm -rf /app/requirements.txt
 
 
 
 
 
 
 
 
 
 
22
 
23
  EXPOSE 7860
24
  ENV GRADIO_SERVER_NAME="0.0.0.0"
25
 
26
+ CMD ["python3", "app.py"]