abhishekrs4 commited on
Commit
df1cb07
1 Parent(s): d239b8f

added dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.8.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # install linux package dependencies
6
+ RUN apt-get update -y
7
+
8
+ # User
9
+ RUN useradd -m -u 1000 user
10
+ USER user
11
+ ENV HOME /home/user
12
+ ENV PATH $HOME/.local/bin:$PATH
13
+
14
+ WORKDIR $HOME
15
+ RUN mkdir app
16
+ WORKDIR $HOME/app
17
+
18
+ # can copy files only from current working directory where docker builds
19
+ # cannot copy files from arbitrary directories
20
+
21
+ COPY ./artifacts/ /data/models/
22
+ COPY ./requirements.txt .
23
+
24
+ RUN pip install --no-cache-dir torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cpu
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
+
27
+ COPY ./cassava_leaf_disease/*.py ./cassava_leaf_disease/
28
+ COPY ./*.py .
29
+ COPY ./*.json .
30
+
31
+ EXPOSE 7860
32
+
33
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]