-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile_v0.1
71 lines (58 loc) · 2.54 KB
/
dockerfile_v0.1
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
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM java:8
MAINTAINER TaeYoung Lee <tylee33@poscoict.com>
ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin
ENV NGINX_VERSION 1.9.11-1~jessie
RUN mkdir -p $SYNTAXNETDIR \
&& cd $SYNTAXNETDIR \
&& apt-get update \
&& apt-get install git zlib1g-dev file swig python2.7 python-dev python-pip python-mock -y \
&& apt-get install -y ca-certificates nginx gettext-base vim \
&& pip install --upgrade pip \
&& pip install -U protobuf==3.0.0b2 \
&& pip install asciitree \
&& pip install numpy \
&& pip install konlpy \
&& pip install uwsgi \
&& wget https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh \
&& chmod +x bazel-0.4.3-installer-linux-x86_64.sh \
&& ./bazel-0.4.3-installer-linux-x86_64.sh --user \
&& git clone --recursive https://github.com/tensorflow/models.git \
&& cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
&& echo -e "\n\n\n\n\n\n\n\n\n" | ./configure \
&& apt-get autoremove -y \
&& apt-get clean
# Make NGINX run on the foreground
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# Copy the modified Nginx conf
COPY nginx.conf /etc/nginx/conf.d/
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY uwsgi.ini /etc/uwsgi/
RUN cd $SYNTAXNETDIR/models/syntaxnet \
&& bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...
RUN cd $SYNTAXNETDIR/models/syntaxnet \
&& git clone --recursive https://github.com/dsindex/syntaxnet.git work
RUN cd $SYNTAXNETDIR/models/syntaxnet/work \
&& ./parser_trainer_test.sh
RUN mkdir -p $SYNTAXNETDIR/models/syntaxnet/work/corpus \
&& cd $SYNTAXNETDIR/models/syntaxnet/work/corpus \
&& wget --content-disposition 'https://lindat.mff.cuni.cz/repository/xmlui/bitstream/handle/11234/1-1548/ud-treebanks-v1.2.tgz?sequence=1&isAllowed=y' \
&& chmod +x ud-treebanks-v1.2.tgz \
&& tar xf ud-treebanks-v1.2.tgz
# Install Supervisord
RUN apt-get update && apt-get install -y supervisor \
&& rm -rf /var/lib/apt/lists/*
# Custom Supervisord config
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY nginx.conf /etc/nginx/conf.d/
COPY ./app /app
RUN pip install -r /app/requirements.txt
RUN mkdir /models
COPY custom_parse.sh $SYNTAXNETDIR/models/syntaxnet/work
RUN chmod 777 $SYNTAXNETDIR/models/syntaxnet/work/custom_parse.sh
EXPOSE 80 443 9000
VOLUME ["/app/config","/models"]
WORKDIR /app
RUN export LANG=C.UTF-8
CMD ["/usr/bin/supervisord"]
# docker build -t tylee/kor_docker .
# docker run -p 9000:9000 -d tylee/kor_docker