simonduerr commited on
Commit
816494e
·
verified ·
1 Parent(s): 6d665a6

Create Dockerfile

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