This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
forked from galaxy-genome-annotation/docker-tripal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
138 lines (115 loc) · 6.5 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
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
FROM php:7.1-apache
MAINTAINER Eric Rasche <[email protected]>
# Install packages and PHP-extensions
RUN apt-get -q update && \
mkdir -p /usr/share/man/man1 /usr/share/man/man7 && \
DEBIAN_FRONTEND=noninteractive apt-get -yq --no-install-recommends install \
file libfreetype6 libjpeg62 libpng16-16 libpq-dev libx11-6 libxpm4 \
postgresql-client wget patch cron logrotate git nano python python-requests python-setuptools \
memcached libmemcached11 libmemcachedutil2 gpg dirmngr ca-certificates && \
BUILD_DEPS="libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev libxpm-dev re2c zlib1g-dev libmemcached-dev python-pip python-dev libpq-dev"; \
DEBIAN_FRONTEND=noninteractive apt-get -yq --no-install-recommends install $BUILD_DEPS \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr/lib/x86_64-linux-gnu --with-png-dir=/usr/lib/x86_64-linux-gnu \
--with-xpm-dir=/usr/lib/x86_64-linux-gnu --with-freetype-dir=/usr/lib/x86_64-linux-gnu \
&& docker-php-ext-install gd mbstring pdo_pgsql zip \
&& pip install chado==2.2.5 tripal==3.2 \
&& pecl install memcached \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
# && pecl install uploadprogress # not yet compatible with php7 on PECL
ENV TINI_VERSION v0.9.0
RUN set -x \
&& curl -fSL "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini" -o /usr/local/bin/tini \
&& chmod +x /usr/local/bin/tini
ENTRYPOINT ["/usr/local/bin/tini", "--"]
# Provide compatibility for images depending on previous versions
RUN ln -s /var/www/html /app
# Update apache2 configuration for drupal
RUN a2enmod rewrite && a2enmod proxy && a2enmod proxy_http
# Compile a php7 compatible version of uploadprogress module
RUN cd /tmp && git clone https://github.com/php/pecl-php-uploadprogress.git && cd pecl-php-uploadprogress && phpize && ./configure && make && make install && cd /
# Download Drupal from ftp.drupal.org
ENV DRUPAL_VERSION=7.64
ENV DRUPAL_TARBALL_MD5=bbb3c4d8c2cba35c48380d34f122f750
WORKDIR /var/www
RUN rm -R html \
&& curl -OsS https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz \
&& echo "${DRUPAL_TARBALL_MD5} drupal-${DRUPAL_VERSION}.tar.gz" | md5sum -c \
&& tar -xf drupal-${DRUPAL_VERSION}.tar.gz && rm drupal-${DRUPAL_VERSION}.tar.gz \
&& mv drupal-${DRUPAL_VERSION} html \
&& cd html \
&& rm [A-Z]*.txt install.php web.config sites/default/default.settings.php
# Install composer and drush by using composer
ENV COMPOSER_BIN_DIR=/usr/local/bin
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer global require drush/drush:7.* \
&& drush cc drush \
&& mkdir /etc/drush && echo "<?php\n\$options['yes'] = TRUE;\n\$options['v'] = TRUE;\n" > /etc/drush/drushrc.php
RUN wget https://github.com/erasche/chado-schema-builder/releases/download/1.31-jenkins110/chado-1.31-tripal.sql.gz -O /chado-master-tripal.sql.gz \
&& wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch -O /drupal.pgsql-bytea.27.patch
WORKDIR html
# Install elasticsearch php library (required by tripal_elasticsearch)
RUN cd /var/www/html/sites/all/libraries/\
&& mkdir elasticsearch-php \
&& cd elasticsearch-php \
&& composer require "elasticsearch/elasticsearch:~5.0" \
&& cd /var/www/html/
ENV BASE_URL_PATH="/tripal" \
GALAXY_SHARED_DIR="/tripal-data/" \
ENABLE_DRUPAL_CACHE=1 \
ENABLE_OP_CACHE=1 \
ENABLE_MEMCACHE=1 \
ENABLE_CRON_JOBS=0 \
TRIPAL_BASE_CODE_GIT="https://github.com/tripal/tripal.git[@1acb14e58691e3e7439ec0026dde99f97eaf4101]" \
TRIPAL_GIT_CLONE_MODULES="https://github.com/abretaud/tripal_rest_api.git[@551c4265f314f0df8a8de45e2f717a2176fee6aa] https://github.com/tripal/tripal_elasticsearch.git[@3e65ced2744ba952389455da20e145f2cdf9ca01] https://github.com/tripal/tripal_analysis_expression.git[@86ca4394103d661808857bb55e383fdf1e569115] https://github.com/tripal/tripal_analysis_blast.git[@6b622eb62e6d80b64b135bc7d31030de6e1c37f5] https://github.com/tripal/tripal_analysis_interpro.git[@d1a12f3d6fc58c10adc02cf74bc29d3a601d0eb5] https://github.com/tripal/tripal_analysis_go.git[@5064d299fa26da01bde17cfa3b04ca5a8aa47887]" \
TRIPAL_DOWNLOAD_MODULES="queue_ui" \
TRIPAL_ENABLE_MODULES="tripal_analysis_blast tripal_analysis_interpro tripal_analysis_go tripal_rest_api tripal_elasticsearch tripal_analysis_expression"
RUN repo_url=`echo $TRIPAL_BASE_CODE_GIT | sed 's/\(.\+\)\[@\w\+\]/\1/'`; \
rev=`echo $TRIPAL_BASE_CODE_GIT | sed 's/.\+\[@\(\w\+\)\]/\1/'`; \
git clone $repo_url /var/www/html/sites/all/modules/tripal; \
if [ "$repo_url" != "$rev" ]; then \
cd /var/www/html/sites/all/modules/tripal; \
git reset --hard $rev; \
cd /var/www/html/; \
fi;
# Pre download all default modules
RUN drush pm-download entity ctools views libraries services ds field_group field_group_table field_formatter_class field_formatter_settings \
ultimate_cron memcache redirect date link \
$TRIPAL_DOWNLOAD_MODULES \
&& for repo in $TRIPAL_GIT_CLONE_MODULES; do \
repo_url=`echo $repo | sed 's/\(.\+\)\[@\w\+\]/\1/'`; \
rev=`echo $repo | sed 's/.\+\[@\(\w\+\)\]/\1/'`; \
module_name=`basename $repo_url .git`; \
git clone $repo_url /var/www/html/sites/all/modules/$module_name; \
if [ "$repo_url" != "$rev" ]; then \
cd /var/www/html/sites/all/modules/$module_name; \
git reset --hard $rev; \
cd /var/www/html/sites/all/modules/; \
fi; \
done
# Temp patch until PR 829 is merged
ADD 829.diff /tmp/829.diff
RUN cd /var/www/html/sites/all/modules/tripal \
&& patch -p1 < /tmp/829.diff \
&& cd /var/www/html/ \
&& rm /tmp/829.diff
RUN cd /var/www/html/sites/all/modules/views \
&& patch -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch \
&& cd /var/www/html/
# Add custom functions
ADD search.sql /search.sql
# Add PHP-settings
ADD php-conf.d/ $PHP_INI_DIR/conf.d/
# Add logrotate conf
ADD logrotate.d/tripal /etc/logrotate.d/
# copy sites/default's defaults
ADD etc/tripal/settings.php /etc/tripal/settings.php
# copy install script
ADD tripal_install.drush.inc /etc/tripal/tripal_install.drush.inc
# Add README.md, entrypoint-script and scripts-folder
ADD entrypoint.sh README.md /
ADD /scripts/ /scripts/
RUN chmod -R +x /scripts/
ADD tripal_apache.conf /etc/apache2/conf-enabled/tripal_apache.conf
CMD ["/entrypoint.sh"]