-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
105 lines (92 loc) · 3.29 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
FROM jantoine/drupal
# Install Composer.
RUN set -ex; \
\
COMPOSER_SIGNATURE=$(curl https://composer.github.io/installer.sig); \
curl -fSL "https://getcomposer.org/installer" -o composer-setup.php; \
echo "${COMPOSER_SIGNATURE} composer-setup.php" | sha384sum -c -; \
php composer-setup.php; \
rm composer-setup.php; \
mv composer.phar /usr/local/bin/composer
# Install GIT.
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
git \
openssh-client \
; \
rm -rf /var/lib/apt/lists/*
# Configure PHP for development.
RUN set -ex; \
\
# Disable PHP's opcache extension so code changes take effect immediately.
rm /usr/local/etc/php/conf.d/opcache-recommended.ini; \
rm /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini; \
\
{ \
echo 'max_execution_time=0'; \
echo 'memory_limit=-1'; \
echo 'post_max_size=0'; \
echo 'upload_max_filesize=0'; \
} >> /usr/local/etc/php/php.ini;
# Install Xdebug.
RUN set -ex; \
\
pecl install xdebug-3.1.6; \
{ \
echo 'zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so'; \
echo 'xdebug.remote_enable=1'; \
echo 'xdebug.remote_autostart=0'; \
echo 'xdebug.remote_connect_back=1'; \
echo 'xdebug.remote_port=9000'; \
} > /usr/local/etc/php/conf.d/ext-xdebug.ini
# Include global composer binaries in PATH.
ENV PATH="$PATH:/usr/local/composer/vendor/bin"
# Install Coder.
RUN set -ex; \
\
export COMPOSER_HOME="/usr/local/composer"; \
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true; \
composer global require drupal/coder; \
phpcs --config-set installed_paths /usr/local/composer/vendor/drupal/coder/coder_sniffer; \
{ \
echo ''; \
echo '# Custom phpcs aliases.'; \
echo "alias drupalcs=\"phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md' --ignore=node_modules,bower_components,vendor\""; \
echo "alias drupalcsp=\"phpcs --standard=DrupalPractice --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md' --ignore=node_modules,bower_components,vendor\""; \
echo "alias drupalcbf=\"phpcbf --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md' --ignore=node_modules,bower_components,vendor\""; \
echo "alias gitcs=\"drupalcs \$(git diff --name-only | tr '\n' ' ')\""; \
echo "alias gitcsp=\"drupalcsp \$(git diff --name-only | tr '\n' ' ')\""; \
echo "alias gitcbf=\"drupalcbf \$(git diff --name-only | tr '\n' ' ')\""; \
} | tee -a ~/.bashrc /etc/skel/.bashrc
# Install Node.js 15.x.
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
; \
curl -sL https://deb.nodesource.com/setup_15.x | bash -; \
apt-get install -y --no-install-recommends \
nodejs \
; \
rm -rf /var/lib/apt/lists/*
# Include the custom bin folder in PATH.
ENV PATH="${PATH}:/usr/mnt/bin"
# Create a custom bin folder for mounting custom scripts into.
RUN set -ex; \
\
mkdir -p /usr/mnt/bin
# Install sudo for the entrypoint.sh script.
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
sudo \
; \
rm -rf /var/lib/apt/lists/*
# Copy scripts.
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]