-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile_all
163 lines (124 loc) · 5.25 KB
/
Dockerfile_all
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
FROM ubuntu:16.04
### Install all packages first, then copy files and do final compilation at the end, to save
### time when rebuilding the image
RUN apt-get update; apt-get -y install nano
RUN apt-get update; apt-get -y install curl
RUN apt-get update; apt-get -y install wget
RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update; apt-get -y remove cmdtest
RUN apt-get update; apt-get -y install yarn
RUN curl -sL http://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update; apt-get -y install nodejs
RUN npm install http-server -g
RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN apt-get -y install apt-transport-https
RUN apt-get update; apt-get -y install dotnet-hosting-2.0.6
RUN apt-get -y install apt-transport-https
RUN apt-get update; apt-get -y install dotnet-sdk-2.1
ENV PYTHONSERVICE_URI http://localhost:7101
ENV RSERVICE_URI http://localhost:7103
ENV DATASTORE_URI http://localhost:7102
ENV RACKETSERVICE_URI http://localhost:7104
ENV AIASERVICE_URI http://localhost:5050
EXPOSE 8080
## datastore
RUN apt-get update; apt-get install -y python3
RUN apt-get update; apt-get install -y python3-pip
RUN apt-get update; apt-get install -y locales
RUN apt-get update; apt-get install -y openssl
RUN apt-get update; apt-get install -y libssl-dev
RUN apt-get update; apt-get install -y git
RUN pip3 install --upgrade pip
RUN pip3 install flask
RUN pip3 install flask_restful
RUN pip3 install flask_cors
RUN pip3 install pyarrow
RUN pip3 install azure
RUN pip3 install tempdir
RUN pip3 install pandas
RUN pip3 install pytest
# Set the locale
RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_GB.UTF-8
ENV LANGUAGE en_GB:en
ENV LC_ALL en_GB.UTF-8
EXPOSE 7102
ENV WRATTLER_LOCAL_DATASTORE True
## python service
RUN pip3 install scikit-learn
RUN pip3 install matplotlib
RUN pip3 install sklearn
RUN pip3 install pandas
RUN pip3 install numpy
RUN pip3 install clevercsv
RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get -y install pkg-config
RUN apt-get -y install libcairo2-dev
RUN pip3 install pycairo
EXPOSE 7101
#### racket service
RUN add-apt-repository ppa:plt/racket && apt-get update && apt-get install -y racket
EXPOSE 7104
#### R service
RUN apt-get update; apt-get install -y libssl-dev
# install R, and setup CRAN mirror
RUN apt-get update; apt-get install -y software-properties-common
RUN apt-get update; apt-get install -y libcurl4-openssl-dev
RUN apt-get update; apt-get install -y libxml2-dev
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN add-apt-repository -y "ppa:marutter/rrutter3.5"
RUN add-apt-repository -y "ppa:marutter/c2d4u"
#RUN apt-get update && apt-get -y install r-cran-rstan
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos='http://cran.rstudio.com/');" > ~/.Rprofile
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/'; apt-get update; apt-get -y install r-base; apt-get -y install r-base-dev
# install needed R packages
RUN Rscript -e "install.packages('ggplot2')"
RUN Rscript -e "install.packages('jug')"
RUN Rscript -e "install.packages('xml2')"
RUN Rscript -e "install.packages('httr')"
RUN Rscript -e "install.packages('purrr')"
RUN Rscript -e "install.packages('testthat')"
RUN Rscript -e "install.packages('httptest')"
RUN Rscript -e "install.packages('cleanEHR')"
RUN Rscript -e "install.packages('reshape2')"
RUN Rscript -e "install.packages('plyr')"
RUN Rscript -e "install.packages('tidyverse')"
RUN Rscript -e "install.packages('lattice')"
RUN Rscript -e "install.packages('gridExtra')"
RUN Rscript -e "install.packages('dplyr')"
RUN Rscript -e "install.packages('readr')"
RUN Rscript -e "install.packages('rlang')"
# install apache arrow
RUN apt-get update; apt-get install -y autoconf autogen
RUN wget https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh
RUN chmod +x cmake-3.12.0-Linux-x86_64.sh
RUN ./cmake-3.12.0-Linux-x86_64.sh --skip-license
RUN ln -s cmake-3.12.0-Linux-x86_64/bin/* /usr/bin
RUN apt-get update; apt-get install -y git
RUN apt-get update; apt-get install -y flex bison
RUN apt-get install -y libboost-all-dev
RUN git clone --branch apache-arrow-0.13.0 https://github.com/apache/arrow.git
RUN cd arrow/cpp && mkdir release && cd release && cmake .. cmake .. -DARROW_PARQUET=ON -DCMAKE_BUILD_TYPE=Release -DARROW_BOOST_USE_SHARED:BOOL=On && make install
RUN Rscript -e "install.packages('devtools')"
RUN Rscript -e "devtools::install_local('arrow/r')"
EXPOSE 7103
#################### copy files and directories onto the image
RUN mkdir python_service
ADD ./server/python /python_service
RUN mkdir R_service
ADD ./server/R /R_service
RUN mkdir /data_store
ADD ./server/data-store /data_store
RUN mkdir racket_service
ADD ./server/racket /racket_service
RUN cd /racket_service; raco pkg install --auto
RUN mkdir client
ADD ./client /client
RUN cd /client; yarn; yarn build;
###### script to run all the services in the background
ADD ./start_all_services.sh /
CMD ["./start_all_services.sh"]
#CMD ["bash"]