-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
59 lines (51 loc) · 1.21 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM alpine:3.11
MAINTAINER Tamas Foldi <[email protected]>
COPY tabpy.conf requirements.txt ./
# based on faizanbashir/python-datascience
ENV PACKAGES="\
dumb-init \
musl \
freetype \
libgfortran \
libstdc++ \
openblas \
tcl \
py3-numpy \
py3-pip \
py3-scipy \
libffi \
cython \
libressl \
libgomp \
libressl3.0-libssl \
python3 \
"
ENV BUILD_PACKAGES="\
linux-headers \
build-base \
git \
bash \
ca-certificates \
libgcc \
gfortran \
cmake \
freetype-dev \
libstdc++ \
libffi-dev \
py3-numpy-dev \
python3-dev \
libressl-dev \
openblas-dev \
"
RUN apk add --no-cache $PACKAGES \
&& apk add --no-cache --virtual build-deps $BUILD_PACKAGES \
&& rm -rf /var/cache/apk/* \
&& adduser -h /tabpy -D -u 1000 tabpy \
&& pip3 install --upgrade pip \
&& pip3 install --no-cache-dir -r requirements.txt \
&& su tabpy -c "python3 -m textblob.download_corpora lite && python3 -m nltk.downloader vader_lexicon" \
&& su -c "tabpy --config ./tabpy.conf & (sleep 1 && tabpy-deploy-models) && killall tabpy" \
&& apk del build-deps
USER 1000:1000
EXPOSE 9004
CMD [ "tabpy", "--config=./tabpy.conf" ]