forked from ybur-yug/python_ocr_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (32 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
43 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# start with a base image
FROM tesseractshadow/tesseract4re
# Turn off debconf messages during build
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
# Install system dependencies
# Docker says run apt-get update and install together,
# and then rm /var/lib/apt/lists to reduce image size.
RUN apt-get update && apt-get install -y \
python3-pil \
python3-requests \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip
# Add requirements.txt before rest of repo, for caching
COPY requirements.txt /
RUN pip3 install -r /requirements.txt
# update working directories
# ADD . /app
COPY ./flask_server /flask_server
WORKDIR /flask_server
# Make debconf interactive in the running container
ENV DEBIAN_FRONTEND teletype
# Set useful ENV vars
ENV PYTHONIOENCODING "utf-8"
# Try to forward request and error logs to docker log collector
# Not sure this works. Use /var/log/nginx/* if running nginx.
RUN ln -sf /dev/stdout /var/log/access.log \
&& ln -sf /dev/stderr /var/log/error.log
# Expose and run
EXPOSE 80
CMD ["python3", "app.py"]