-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathDockerfile
36 lines (33 loc) · 1.18 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
FROM python:3.6-alpine
MAINTAINER Sang Han <jjangsangy@gmail.com>
COPY ./requirements.txt /requirements.txt
RUN apk add --no-cache --virtual .build-deps \
build-base \
curl \
git \
jpeg-dev \
libffi-dev \
libpng-dev \
libuv-dev \
libxml2-dev \
libxslt-dev \
python3-dev \
zlib-dev \
&& LDFLAGS="$LDFLAGS -L/lib" pip install -r /requirements.txt \
&& find /usr/local \( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& runDeps="$(scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u)" \
&& apk add --virtual .rundeps $runDeps \
&& apk del .build-deps \
&& python -c 'import nltk; print("nltk version: %s" % nltk.__version__); nltk.download("punkt")' \
&& rm -rf /root/.cache
ENV INSTALL_PATH /app
COPY . ${INSTALL_PATH}
WORKDIR ${INSTALL_PATH}
EXPOSE 5000
ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:5000","ExplainToMe.wsgi:app"]