valerii777 commited on
Commit
e29055a
·
verified ·
1 Parent(s): 29435cd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch
2
+
3
+ # if you forked EasyOCR, you can pass in your own GitHub username to use your fork
4
+ # i.e. gh_username=myname
5
+ ARG gh_username=JaidedAI
6
+ ARG service_home="/home/EasyOCR"
7
+
8
+ # Configure apt and install packages
9
+ RUN apt-get update -y && \
10
+ apt-get install -y \
11
+ libglib2.0-0 \
12
+ libsm6 \
13
+ libxext6 \
14
+ libxrender-dev \
15
+ libgl1-mesa-dev \
16
+ git \
17
+ # cleanup
18
+ && apt-get autoremove -y \
19
+ && apt-get clean -y \
20
+ && rm -rf /var/lib/apt/li
21
+
22
+ # Clone EasyOCR repo
23
+ RUN mkdir "$service_home" \
24
+ && git clone "https://github.com/$gh_username/EasyOCR.git" "$service_home" \
25
+ && cd "$service_home" \
26
+ && git remote add upstream "https://github.com/JaidedAI/EasyOCR.git" \
27
+ && git pull upstream master
28
+
29
+ # Build
30
+ RUN cd "$service_home" \
31
+ && python setup.py build_ext --inplace -j 4 \
32
+ && python -m pip install -e .
33
+
34
+ ADD ./recognition.py /home/ubuntu/
35
+ WORKDIR /home/ubuntu/
36
+
37
+ RUN pip install Flask
38
+
39
+ EXPOSE 2000
40
+ RUN alias python=python3
41
+ ENTRYPOINT ["python"]
42
+ CMD ["/home/ubuntu/recognition.py"]