-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
40 lines (33 loc) · 1.44 KB
/
Dockerfile
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
FROM python:3.6
MAINTAINER harumonia
WORKDIR /Poirot
USER root
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.1.4
# 国内用户可以将source更换为阿里的镜像
# RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get clean \
&& apt-get update -y \
&& apt-get -y install tesseract-ocr \
&& apt-get install -y libtesseract-dev \
&& apt-get -y install tesseract-ocr-chi-sim
COPY pyproject.toml /Poirot/
#-------国内用户可以反转以下语句以提高构建速度-------
RUN pip install --upgrade pip && pip install poetry
# RUN pip install --upgrade pip -i https://pypi.douban.com/simple
# RUN pip install poetry -i https://pypi.douban.com/simple
# RUN poetry config repositories.douban https://pypi.douban.com/simple/
# --------------------END---------------------
# use douban packages when build on local pc, but it will cause a error on docker hub.
RUN poetry config virtualenvs.create false && poetry install --no-dev --no-interaction --no-ansi
# COPY poetry.lock pyproject.toml /Poirot/
# RUN poetry config virtualenvs.create false && poetry install --no-dev --no-interaction --no-ansi
COPY . /Poirot
RUN mkdir -p /logs/gunicorn/ && chmod 777 /logs/gunicorn/
ENTRYPOINT ["gunicorn", "app:app", "-c", "./gunicorn.conf.py"]
# ENTRYPOINT ["flask","run","--host","0.0.0.0"]