-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (44 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
57 lines (44 loc) · 1.92 KB
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
ARG BASE_IMAGE_TAG=11.1
FROM drupal:${BASE_IMAGE_TAG}-apache
ARG DRUPAL_VER
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV DRUPAL_VER="${DRUPAL_VER}"
WORKDIR /opt/drupal
# Install git and zip library.
# Necessary for some composer operations.
RUN set -eux; \
\
apt-get update; \
apt-get install -y \
git \
zip \
unzip \
;
# Install wait-for-it script to be able to check if services are up.
RUN curl -OL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
chmod +x wait-for-it.sh && \
mv wait-for-it.sh /usr/local/bin/wait-for-it
# As of Composer 2.2.0, the allow-plugins option adds a layer of security.
# Some plugin Installer must be authorized. Not allowing it may lead to an instance of Drupal
# installed into the vendor directory.
RUN composer config --no-interaction allow-plugins true
# Install Drupal Dev dependencies such as PHPUnit, Behat-Mink, ...
RUN COMPOSER_MEMORY_LIMIT=-1 composer require --dev drupal/core-dev:~${DRUPAL_VERSION}
# Install Drush.
# Drush will be heavily use to setup a working Drupal environment.
RUN COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush:^13.0
# Clean repository.
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Set proper permissions for Drupal files directory
RUN mkdir -p /opt/drupal/web/sites/default/files
RUN chown www-data:www-data /opt/drupal/web/sites/default/files
RUN chmod -R 775 /opt/drupal/web/sites/default/files
# Set proper permissions for Drupal Simpletest directory.
RUN mkdir -p /opt/drupal/web/sites/simpletest/
RUN chown www-data:www-data /opt/drupal/web/sites/simpletest
RUN chmod -R 775 /opt/drupal/web/sites/simpletest
# Copy a default template for PHPUnit testing.
COPY templates/phpunit.xml /opt/drupal/web/phpunit.xml
# Create the output directory for PHPUnit.
RUN mkdir -p /opt/drupal/web/sites/default/files/simpletest/browser_output
RUN chown www-data:www-data /opt/drupal/web/sites/default/files/simpletest/browser_output