This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
111 lines (71 loc) · 2.74 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM debian:8.10
MAINTAINER Jonathan Gordon <[email protected]>
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# Install basic system dependencies.
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -q -y --fix-missing \
&& apt-get install -q -y --fix-missing --no-install-recommends \
bison bzip2 ca-certificates flex g++ git libssl-dev make wget \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda.
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \
&& wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O /tmp/miniconda.sh -q \
&& bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm /tmp/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
RUN conda update -y conda \
&& conda install -y ansi2html beautifulsoup4 flask ftfy lxml
# Install Gurobi.
ENV GUROBI_INSTALL /interpret/ext/gurobi
ENV GUROBI_HOME $GUROBI_INSTALL/linux64
WORKDIR /interpret/ext
RUN mkdir -p "$GUROBI_INSTALL/scripts" \
&& wget http://packages.gurobi.com/6.0/gurobi6.0.5_linux64.tar.gz \
&& tar xvzf gurobi6.0.5_linux64.tar.gz \
&& mv gurobi605/linux64 "$GUROBI_INSTALL" \
&& rm -rf "$GUROBI_HOME/docs" "$GUROBI_HOME/examples" "$GUROBI_HOME/src" \
gurobi605 gurobi6.0.5_linux64.tar.gz
ENV PATH $PATH:$GUROBI_HOME/bin
ENV CPLUS_INCLUDE_PATH $GUROBI_HOME/include:$CPLUS_INCLUDE_PATH
ENV LD_LIBRARY_PATH $GUROBI_HOME/lib:$LD_LIBRARY_PATH
ENV GRB_LICENSE_FILE $GUROBI_INSTALL/license/gurobi.lic
# Install Phillip.
RUN apt-get update -q -y --fix-missing \
&& apt-get install -q -y --fix-missing --no-install-recommends \
graphviz liblpsolve55-dev lp-solve \
&& rm -rf /var/lib/apt/lists/*
ENV CPLUS_INCLUDE_PATH /usr/include/lpsolve:$CPLUS_INCLUDE_PATH
ENV LD_LIBRARY_PATH /usr/lib/lp_solve:$LD_LIBRARY_PATH
ENV LIBRARY_PATH /usr/lib/lp_solve:$GUROBI_HOME/lib:$LIBRARY_PATH
WORKDIR /interpret/ext
RUN git clone https://github.com/kazeto/phillip
WORKDIR /interpret/ext/phillip
RUN 2to3 -w tools/configure.py \
&& 2to3 -w tools/util.py \
&& 2to3 -w tools/graphviz.py \
&& /bin/echo -e "\ny\ny" | python ./tools/configure.py \
&& make LDFLAGS="-lcolamd -llpsolve55 -lgurobi_c++ -lgurobi60 -ldl"
# Add the C&C pipeline and compile.
RUN apt-get update -q -y --fix-missing \
&& apt-get install -q -y --fix-missing --no-install-recommends \
gsoap swi-prolog \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /interpret/ext
RUN git clone https://github.com/jgordon/boxer candc
WORKDIR /interpret/ext/candc
RUN make \
&& make bin/t \
&& make bin/boxer \
&& make soap
RUN tar -xjvf models-1.02.tar.bz2 \
&& rm models-1.02.tar.bz2
# Add the application code to the Docker image.
COPY app /interpret/app
COPY kb /interpret/kb
COPY server /interpret
# Run our server.
EXPOSE 5000
WORKDIR /interpret
CMD ["./server"]