-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
160 lines (153 loc) · 4.92 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
FROM php:5.6-stretch
RUN additionalPackages=" \
apt-transport-https \
git \
msmtp-mta \
openssh-client \
rsync \
subversion \
sudo \
" \
buildDeps=" \
freetds-dev \
libbz2-dev \
libc-client-dev \
libenchant-dev \
libfreetype6-dev \
libgmp3-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libldap2-dev \
libmcrypt-dev \
libpq-dev \
libpspell-dev \
librabbitmq-dev \
libsasl2-dev \
libsnmp-dev \
libssl-dev \
libtidy-dev \
libxml2-dev \
libxpm-dev \
libxslt1-dev \
libzip-dev \
zlib1g-dev \
" \
runDeps=" \
libc-client2007e \
libenchant1c2a \
libfreetype6 \
libicu57 \
libjpeg62-turbo \
libmcrypt4 \
libzip4 \
libpng16-16 \
libpq5 \
libsybdb5 \
libtidy5 \
libx11-6 \
libxpm4 \
libxslt1.1 \
snmp \
gnupg \
" \
phpModules=" \
bcmath \
bz2 \
calendar \
dba \
enchant \
exif \
ftp \
gd \
gettext \
gmp \
imap \
intl \
ldap \
mbstring \
mysqli \
opcache \
pcntl \
pdo \
pdo_dblib \
pdo_mysql \
pdo_pgsql \
pgsql \
pspell \
shmop \
snmp \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
wddx \
xmlrpc \
xsl \
zip \
" \
&& echo "deb http://security.debian.org/ stretch/updates main contrib non-free" > /etc/apt/sources.list.d/additional.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends $additionalPackages $buildDeps $runDeps \
&& docker-php-source extract \
&& cd /usr/src/php/ext/ \
&& ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
&& ln -s /usr/lib/x86_64-linux-gnu/libldap_r.so /usr/lib/libldap.so \
&& ln -s /usr/lib/x86_64-linux-gnu/libldap_r.a /usr/lib/libldap_r.a \
&& ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/libsybdb.a \
&& ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-xpm-dir=/usr/include/ \
&& 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 \
&& printf "\n" | pecl install amqp \
&& pecl install mongodb \
&& for ext in $phpModules; do \
rm -f /usr/local/etc/php/conf.d/docker-php-ext-$ext.ini; \
done \
&& docker-php-source delete \
&& docker-php-ext-enable $phpModules \
&& 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 prestissimo plugin 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 \
&& /usr/local/bin/composer global require hirak/prestissimo
# Install phpunit and put binary into $PATH
RUN curl -sSLo phpunit.phar https://phar.phpunit.de/phpunit-5.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 buildDeps=" \
libpng-dev \
libzip-dev \
" \
runDeps=" \
libpng16-16 \
libzip4 \
" \
&& 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_10.x | bash - \
&& apt-get update \
&& apt-get install -y unzip nodejs build-essential yarn \
&& yarn global add pngquant-bin jpegtran-bin cwebp-bin optipng-bin node-sass \
&& 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/*
COPY msmtprc /etc/
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php", "-a"]