Dockerfile 3.62 KB
Newer Older
msuhr1's avatar
msuhr1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM drupal:7-apache

# Install PHP extension: imagemagick
RUN apt-get update && \
    apt-get install -y libmagickwand-dev --no-install-recommends && \
    pecl install imagick && \
    docker-php-ext-enable imagick && \
    apt-get clean

# Install the tools git, wget, unzip
RUN apt-get update && apt-get install -y git wget unzip --no-install-recommends && \
    apt-get clean

# Install composer
RUN curl -sS https://getcomposer.org/installer | \
    php -- --install-dir=/usr/bin/ --filename=composer

18
19
20
21
22
# Install msmtp for mail forwarding to another SMTP server
# /etc/msmtprc configuration file needs to be mapped into the container
RUN apt-get update && apt-get install -y msmtp --no-install-recommends && \
    apt-get clean \
    && ln -s /usr/bin/msmtp /usr/sbin/sendmail
msuhr1's avatar
msuhr1 committed
23
24
25
26
27
28
29
30
31
32
33
34

#
# Install Drupal theme dependencies
#
USER www-data:www-data

WORKDIR /var/www/html/sites/all/themes

RUN wget https://ftp.drupal.org/files/projects/bootstrap-7.x-3.26.tar.gz \
    && tar xzfv bootstrap-7.x-3.26.tar.gz \
    && rm bootstrap-7.x-3.26.tar.gz

Luca Freckmann's avatar
Luca Freckmann committed
35
36
37
38
RUN wget https://gitlab.gwdg.de/research-data-platform/menoci-theme/-/archive/master/menoci-theme-master.tar.gz \
    && tar xzfv menoci-theme-master.tar.gz \
    && rm menoci-theme-master.tar.gz

msuhr1's avatar
msuhr1 committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Download Bootstrap library distribution files for local delivery instead of third-party CDN usage
#   Library files will be available to the Drupal engine under relative path
#   sites/all/libraries/bootstrap/
#
WORKDIR /var/www/html/sites/all/libraries

RUN wget https://github.com/twbs/bootstrap/releases/download/v3.4.1/bootstrap-3.4.1-dist.zip \
    && unzip bootstrap-3.4.1-dist.zip \
    && mv bootstrap-3.4.1-dist bootstrap \
    && rm bootstrap/css/bootstrap-theme* \
    && rm bootstrap-3.4.1-dist.zip

#
# Install Drupal module dependencies
#
WORKDIR /var/www/html/sites/all/modules

RUN wget https://ftp.drupal.org/files/projects/jquery_update-7.x-2.7.tar.gz \
    && tar xzfv jquery_update-7.x-2.7.tar.gz \
    && rm jquery_update-7.x-2.7.tar.gz

61
62
63
RUN wget https://ftp.drupal.org/files/projects/entity-7.x-1.10.tar.gz \
    && tar xzfv entity-7.x-1.10.tar.gz \
    && rm entity-7.x-1.10.tar.gz
msuhr1's avatar
msuhr1 committed
64

65
66
67
RUN wget https://ftp.drupal.org/files/projects/profile2-7.x-1.7.tar.gz \
    && tar xzfv profile2-7.x-1.7.tar.gz \
    && rm profile2-7.x-1.7.tar.gz
msuhr1's avatar
msuhr1 committed
68
69
70
71
72

RUN wget https://ftp.drupal.org/files/projects/account_profile-7.x-2.0.tar.gz \
    && tar xzfv account_profile-7.x-2.0.tar.gz \
    && rm account_profile-7.x-2.0.tar.gz

Luca Freckmann's avatar
Luca Freckmann committed
73
74
75
RUN wget https://ftp.drupal.org/files/projects/date-7.x-2.11.tar.gz \
    && tar xzfv date-7.x-2.11.tar.gz \
    && rm date-7.x-2.11.tar.gz
msuhr1's avatar
msuhr1 committed
76

Luca Freckmann's avatar
Luca Freckmann committed
77
78
79
80
81
RUN wget https://ftp.drupal.org/files/projects/miniorange_oauth_client-7.x-1.347.tar.gz \
    && tar xzfv miniorange_oauth_client-7.x-1.347.tar.gz \
    && rm miniorange_oauth_client-7.x-1.347.tar.gz


msuhr1's avatar
msuhr1 committed
82
83
84
85
#
# Install menoci modules
#
WORKDIR /var/www/html/sites/all/modules
86
87
RUN mkdir menoci
ADD ./ menoci/
Luca Freckmann's avatar
Luca Freckmann committed
88
89
90
WORKDIR /var/www/html/sites/all/modules/menoci
RUN ./update.sh
WORKDIR /var/www/html/sites/all/modules
91
92
93
94
# Clean up
USER root
RUN find menoci/ -type f -maxdepth 1 -delete && chown www-data: -R .

95
# Install RDP module dependencies
96
USER www-data:www-data
msuhr1's avatar
msuhr1 committed
97
98
99
100
RUN cd menoci/rdp-wikidata && composer install
RUN cd menoci && git submodule init rdp-archive/cdstar/lib/jwt/ \
    && git submodule update rdp-archive/cdstar/lib/jwt/
# Clean up
101
RUN find . -maxdepth 1 -type f -delete && rm -rf menoci/.git
102

msuhr1's avatar
msuhr1 committed
103
#
104
# All done; set workdir to webroot
msuhr1's avatar
msuhr1 committed
105
#
106
WORKDIR /var/www/html/
Luca Freckmann's avatar
Luca Freckmann committed
107
108

#
109
110
111
112
113
# Add a custom php.ini file for Drupal project
#
RUN echo "upload_max_filesize = 50M" > php.ini \
    && echo "post_max_size = 50M" >> php.ini \
    && echo "sendmail_path = '/usr/sbin/sendmail -t -i'" >> php.ini
114
115

USER root:root