haritsahm commited on
Commit
4191136
1 Parent(s): ed80dbe

Add dockerfile and requirements

Browse files
Files changed (3) hide show
  1. .dockerignore +7 -0
  2. Dockerfile +42 -0
  3. requirements.txt +1 -0
.dockerignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ *
2
+ !configs/
3
+ !models/
4
+ !sample_data/
5
+ !requirements.txt
6
+ !app.py
7
+ !Description.md
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ubuntu:20.04
2
+
3
+ ENV GRADIO_SERVER_NAME=0.0.0.0
4
+
5
+ RUN apt update && \
6
+ apt install -y bash \
7
+ build-essential \
8
+ git \
9
+ curl \
10
+ ca-certificates \
11
+ python3 \
12
+ python3-pip && \
13
+ rm -rf /var/lib/apt/lists
14
+
15
+ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
16
+ python3 -m pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
17
+ torch \
18
+ torchvision \
19
+ torchaudio
20
+
21
+ WORKDIR /code
22
+
23
+ COPY ./requirements.txt /code/requirements.txt
24
+
25
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
26
+
27
+ # Set up a new user named "user" with user ID 1000
28
+ RUN useradd -m -u 1000 user
29
+
30
+ # Switch to the "user" user
31
+ USER user
32
+ # Set home to the user's home directory
33
+ ENV HOME=/home/user \
34
+ PATH=/home/user/.local/bin:$PATH
35
+
36
+ # Set the working directory to the user's home directory
37
+ WORKDIR $HOME/app
38
+
39
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
40
+ COPY --chown=user . $HOME/app
41
+
42
+ CMD ["python3", "app.py"]
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  monai==1.1.0
2
  scikit-image==0.20.0
 
 
1
  monai==1.1.0
2
  scikit-image==0.20.0
3
+ gradio