forked from CatalystCode/opener-docker-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (23 loc) · 894 Bytes
/
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
FROM alpine:3.6
ENV BUILD_DEPENDENCIES "build-base python3-dev"
RUN apk add --update --no-cache ${BUILD_DEPENDENCIES}
# Install Python 3.6
RUN apk add --no-cache python3 libstdc++ \
&& python3 -m ensurepip \
&& rm -r /usr/lib/python*/ensurepip \
&& pip3 install --upgrade pip setuptools \
&& if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip; fi
# Set up tokenizer server
ADD requirements.txt /app/requirements.txt
RUN pip3 install -r /app/requirements.txt
ADD run_server.py /server.py
# Cleanup
RUN apk del ${BUILD_DEPENDENCIES} \
&& rm -r /root/.cache \
&& rm /app/requirements.txt
ENV SANIC_OPENER_IDENTIFY_LANGUAGE_URL "http://opener-language-identifier"
ENV SANIC_OPENER_TOKENIZE_URL "http://opener-tokenizer"
ENV SANIC_OPENER_POS_URL "http://opener-pos-tagger"
ENV SANIC_OPENER_NER_URL "http://opener-ner"
EXPOSE 80
CMD ["python3.6", "/server.py", "--port", "80"]