-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
7.4.Dockerfile
165 lines (157 loc) · 4.91 KB
/
7.4.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
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
FROM php:7.4
ENV XDEBUG_VERSION 2.9.8
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
# https://getcomposer.org/doc/03-cli.md#composer-no-interaction
ENV COMPOSER_NO_INTERACTION=1
RUN additionalPackages=" \
apt-transport-https \
git \
wget \
gnupg \
msmtp-mta \
subversion \
mariadb-client \
openssh-client \
rsync \
unzip \
" \
buildDeps=" \
freetds-dev \
libbz2-dev \
libc-client-dev \
libffi-dev \
libfreetype6-dev \
libgmp3-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmagickwand-dev \
libkrb5-dev \
libldap2-dev \
libmcrypt-dev \
libpng-dev \
libpq-dev \
libpspell-dev \
libonig-dev \
librabbitmq-dev \
libsasl2-dev \
libsnmp-dev \
libssl-dev \
libtidy-dev \
libxml2-dev \
libxpm-dev \
libxslt1-dev \
zlib1g-dev \
libzip-dev \
" \
&& runDeps=" \
imagemagick \
libc-client2007e \
libfreetype6 \
libicu-dev \
libjpeg62-turbo \
libpq5 \
libsybdb5 \
libtidy-dev \
libx11-dev \
libxpm4 \
libxslt1.1 \
libzip4 \
snmp \
" \
&& phpModules=" \
bcmath \
bz2 \
calendar \
dba \
exif \
ffi \
ftp \
gd \
gettext \
gmp \
imap \
intl \
ldap \
mysqli \
opcache \
pcntl \
pdo \
pdo_dblib \
pdo_mysql \
pdo_pgsql \
pgsql \
pspell \
shmop \
snmp \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
xmlrpc \
xsl \
zip \
xdebug \
" \
&& peclModules=" \
igbinary \
imagick \
mongodb \
redis \
" \
&& echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup \
&& echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $additionalPackages $buildDeps $runDeps \
&& docker-php-source extract \
&& cd /usr/src/php/ext/ \
&& curl -L https://xdebug.org/files/xdebug-$XDEBUG_VERSION.tgz | tar -zxf - \
&& mv xdebug-$XDEBUG_VERSION xdebug \
&& ln -s /usr/include/*-linux-gnu/gmp.h /usr/include/gmp.h \
&& ln -s /usr/lib/*-linux-gnu/libldap_r.so /usr/lib/libldap.so \
&& ln -s /usr/lib/*-linux-gnu/libldap_r.a /usr/lib/libldap_r.a \
&& ln -s /usr/lib/*-linux-gnu/libsybdb.a /usr/lib/libsybdb.a \
&& ln -s /usr/lib/*-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure imap --with-imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-configure ldap --with-ldap-sasl \
&& docker-php-ext-install $phpModules \
&& for ext in $phpModules; do \
rm -f /usr/local/etc/php/conf.d/docker-php-ext-$ext.ini; \
done \
&& pecl install $peclModules \
&& docker-php-source delete \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install composer and put binary into $PATH
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
# Install phpunit and put binary into $PATH
RUN curl -sSLo phpunit.phar https://phar.phpunit.de/phpunit.phar \
&& chmod 755 phpunit.phar \
&& mv phpunit.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/phpunit.phar /usr/local/bin/phpunit
# Install PHP Code sniffer
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar \
&& chmod 755 phpcs.phar \
&& mv phpcs.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/phpcs.phar /usr/local/bin/phpcs \
&& curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar \
&& chmod 755 phpcbf.phar \
&& mv phpcbf.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/phpcbf.phar /usr/local/bin/phpcbf
# Install Node.js & Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs build-essential yarn \
&& rm -Rf /etc/apt/sources.list.d/yarn.list \
&& rm -Rf /etc/apt/sources.list.d/nodesource.list \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY msmtprc /etc/
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php", "-a"]