haritsahm commited on
Commit
571b727
·
1 Parent(s): cc64157

Add dockerfile and requirements

Browse files
Files changed (2) hide show
  1. Dockerfile +40 -0
  2. requirements.txt +5 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ubuntu:20.04
2
+
3
+ RUN apt update && \
4
+ apt install -y bash \
5
+ build-essential \
6
+ git \
7
+ curl \
8
+ ca-certificates \
9
+ python3 \
10
+ python3-pip && \
11
+ rm -rf /var/lib/apt/lists
12
+
13
+ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
14
+ python3 -m pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
15
+ torch \
16
+ torchvision \
17
+ torchaudio
18
+
19
+ WORKDIR /code
20
+
21
+ COPY ./requirements.txt /code/requirements.txt
22
+
23
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
24
+
25
+ # Set up a new user named "user" with user ID 1000
26
+ RUN useradd -m -u 1000 user
27
+
28
+ # Switch to the "user" user
29
+ USER user
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
+ CMD ["python3", "main.py"]
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ gradio>=3.0
2
+ numpy==1.24.2
3
+ opencv-python-headless==4.6.0.66
4
+ Pillow==9.3.0
5
+ scipy==1.9.2