forked from aueb-wim/LORIS-for-MIP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_php
177 lines (137 loc) · 5.84 KB
/
Dockerfile_php
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -y \
apt-utils --no-install-recommends \
zip \
unzip \
curl \
wget \
python-software-properties \
software-properties-common \
make \
language-pack-en-base \
apache2
ENV LC_ALL C.UTF-8
RUN add-apt-repository -y ppa:ondrej/php
RUN apt-get update \
&& apt-get install -y \
php7.2 \
php7.2-mysql \
php7.2-xml \
php7.2-json \
php7.2-mbstring \
php7.2-gd \
php-ast \
mysql-client \
php-zip \
composer \
libapache2-mod-php7.2
RUN a2enmod php7.2
# Creating a User for LORIS
RUN useradd -U -m -G sudo -s /bin/bash lorisadmin \
&& echo lorisadmin:12345678 | chpasswd \
&& usermod -a -G www-data lorisadmin
COPY ./loris /var/www/loris
RUN chown -R lorisadmin.lorisadmin /var/www/loris
RUN rm -r /var/www/loris/modules/dicom_archive/*
RUN rm -r /var/www/loris/modules/imaging_browser/*
RUN rm -r /var/www/loris/modules/candidate_list/*
COPY ./dicom_archive /var/www/loris/modules/dicom_archive/
COPY ./imaging_browser /var/www/loris/modules/imaging_browser/
COPY ./candidate_list /var/www/loris/modules/candidate_list/
COPY ./aueb_files/install_aueb.sh /var/www/loris/tools/install_aueb.sh
WORKDIR /var/www/loris/tools
RUN su - lorisadmin && bash install_aueb.sh
RUN a2enmod rewrite \
&& a2ensite loris \
&& chmod 775 /var/www/loris/project/ \
&& echo "ServerName localhost" >> /etc/apache2/apache2.conf
#&& \ a2enconf fqdn
#donwload composer
WORKDIR /var/www/loris
# Select php7.2 as default
RUN update-alternatives --set php /usr/bin/php7.2
#COPY ./other_files/composer-setup.php ./
# RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
#RUN php -r "if (hash_file('sha384', 'composer-setup.php') === 'baf1608c33254d00611ac1705c1d9958c817a1a33bce370c0595974b342601bd80b92a3f46067da89e3b06bff421f182') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
#RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
#RUN composer install
# Nodejs installation
RUN curl -sL https://deb.nodesource.com/setup_8.x > install_node.sh \
&& bash install_node.sh \
&& apt-get install -y nodejs
RUN make
#Install imaging pipeline
RUN apt-get install -y \
python3 \
python3-dev \
python3-pip \
libmysqlclient-dev \
libc6 \
libstdc++6 \
imagemagick \
perl \
cpanminus \
dcmtk \
libssl-dev \
&& pip3 install virtualenv
WORKDIR /tmp
RUN wget http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_16.04-x86_64.deb \
&& wget http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-testsuite-0.1.3-20131212.deb \
&& wget http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/beast-library-1.1.0-20121212.deb \
&& wget http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/bic-mni-models-0.1.1-20120421.deb
RUN dpkg -i minc-toolkit-1.9.17-20190313-Ubuntu_16.04-x86_64.deb \
&& dpkg -i minc-toolkit-testsuite-0.1.3-20131212.deb \
&& dpkg -i beast-library-1.1.0-20121212.deb \
&& dpkg -i bic-mni-models-0.1.1-20120421.deb
# # "Installing the perl libraries...This will take a few minutes..."
RUN ["cpanm", "--force", "Math::Round", "DBI", "DBD::mysql","Getopt::Tabular", \
"Time::JulianDay", "Path::Class", "Archive::Extract", "Archive::Zip", \
"Pod::Perldoc", "Pod::Markdown", "Pod::Usage", "JSON", "Moose", \
"MooseX::Privacy", "TryCatch", "Throwable"]
#RUN /bin/bash -c "source /opt/minc/1.9.17/minc-toolkit-config.sh"
RUN su lorisadmin && mkdir -m 2770 -p /data/loris/data/ \
&& mkdir -m 770 -p /data/loris/data/trashbin \
&& mkdir -m 770 -p /data/loris/data/tarchive \
&& mkdir -m 770 -p /data/loris/data/pic \
&& mkdir -m 770 -p /data/loris/data/logs \
&& mkdir -m 770 -p /data/loris/data/assembly \
&& mkdir -m 770 -p /data/loris/data/batch_output \
&& mkdir -m 770 -p /data/loris/data/bids_imports \
&& mkdir -m 770 -p /data/loris/bin/mri/dicom-archive/.loris_mri
#&& chown -R lorisadmin:lorisadmin /data/loris
RUN su lorisadmin && mkdir /data/loris/python/ \
&& mkdir /data/loris/aueb/ \
&& mkdir /data/incoming \
&& mkdir /data/tmp \
&& mkdir -m 2777 /data/loris/csvs \
&& mkdir -m 2770 /data/loris/nifti_out \
&& mkdir -m 2770 /data/loris/dicom_post
COPY ./aueb_files/imaging_install_aueb.sh /data/loris/bin/mri
COPY ./mri_loris /data/loris/bin/mri
#COPY ./python/* /data/loris/python/
COPY ./aueb_files/cred.txt /data/loris/aueb/cred.txt
COPY ./aueb_files/installdb.php /data/loris/aueb/installdb.php
COPY ./aueb_files/curl_query.sh /data/loris/aueb/curl_query.sh
COPY ./aueb_files/setup.sh /data/loris/aueb/setup.sh
COPY ./sql /data/loris/aueb/sql
#RUN cp -r /data/loris/bin/mri/uploadNeuroDB /data/loris/data/uploadNeuroDB \
RUN chown -R lorisadmin:lorisadmin /data/loris \
&& chgrp www-data -R /data/loris \
&& chgrp www-data -R /data/incoming \
&& chgrp www-data -R /data/loris/csvs \
&& chgrp www-data -R /data/loris/nifti_out \
&& chgrp www-data -R /data/loris/dicom_post \
&& chmod -R g+s /data/loris/data/
RUN python3 -m virtualenv --python=/usr/bin/python3 /data/loris/bin/mri/python_virtualenvs/loris-mri-python
RUN . /data/loris/bin/mri/python_virtualenvs/loris-mri-python/bin/activate \
&& pip install --upgrade pip \
&& pip install mysqlclient pybids pyblake2 mne google protobuf mysql-connector \
requests==2.22.0 pandas==0.24.2 xmltodict==0.12.0 pydicom==1.3.0
RUN echo "source /data/loris/bin/mri/environment" >> /root/.bashrc
RUN echo "source /data/loris/bin/mri/environment" >> /home/lorisadmin/.bashrc
RUN apt-get install -y minc-tools file dcmtk
WORKDIR /data/loris/
EXPOSE 80
ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]