-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
223 lines (174 loc) · 4.79 KB
/
Dockerfile
File metadata and controls
223 lines (174 loc) · 4.79 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
FROM php:7.1-fpm
MAINTAINER Jan Forgac <forgac@artweby.cz>
ENV DEBIAN_FRONTEND noninteractive
COPY bin/* /usr/local/bin/
RUN chmod -R 700 /usr/local/bin/
# Locales
RUN apt-get update \
&& apt-get install -y locales
RUN dpkg-reconfigure locales \
&& locale-gen C.UTF-8 \
&& /usr/sbin/update-locale LANG=C.UTF-8
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen \
&& locale-gen
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Common
RUN apt-get update \
&& apt-get install -y \
openssl \
git
# PHP
# intl
RUN apt-get update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl
# xml
RUN apt-get update \
&& apt-get install -y \
libxml2-dev \
libxslt-dev \
&& docker-php-ext-install \
dom \
xmlrpc \
xsl
# images
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng12-dev \
libgd-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install \
gd \
exif
# database
RUN docker-php-ext-install \
mysqli \
pdo \
pdo_mysql
# mcrypt
RUN apt-get update \
&& apt-get install -y libmcrypt-dev \
&& docker-php-ext-install mcrypt
# strings
RUN docker-php-ext-install \
gettext \
mbstring
# math
RUN apt-get update \
&& apt-get install -y libgmp-dev \
&& ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
&& docker-php-ext-install \
gmp \
bcmath
# compression
RUN apt-get update \
&& apt-get install -y \
libbz2-dev \
zlib1g-dev \
&& docker-php-ext-install \
zip \
bz2
# ftp
RUN apt-get update \
&& apt-get install -y \
libssl-dev \
&& docker-php-ext-install \
ftp
# ssh2
RUN apt-get update \
&& apt-get install -y \
libssh2-1-dev
# others
RUN docker-php-ext-install \
soap \
sockets \
calendar \
sysvmsg \
sysvsem \
sysvshm
# PECL
RUN docker-php-pecl-install \
# ssh2-1.0 \
redis-3.0 \
apcu-5.1.7
# SSH2
# TODO PECL is buggy, we must compile it.
RUN git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 \
&& docker-php-ext-install ssh2
# Memcached
# TODO PECL not available for PHP 7 yet, we must compile it.
RUN apt-get update \
&& apt-get install -y \
libmemcached-dev \
libmemcached11
RUN cd /tmp \
&& git clone -b php7 https://github.com/php-memcached-dev/php-memcached \
&& cd php-memcached \
&& phpize \
&& ./configure \
&& make \
&& cp /tmp/php-memcached/modules/memcached.so /usr/local/lib/php/extensions/no-debug-non-zts-20151012/memcached.so \
&& docker-php-ext-enable memcached
# Install XDebug, but not enable by default. Enable using:
# * php -d$XDEBUG_EXT vendor/bin/phpunit
# * php_xdebug vendor/bin/phpunit
RUN pecl install xdebug-2.5.0
ENV XDEBUG_EXT zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
RUN alias php_xdebug="php -d$XDEBUG_EXT vendor/bin/phpunit"
# 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 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 PHPUnit
RUN curl -OL 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
ADD php.ini /usr/local/etc/php/conf.d/docker-php.ini
## NodeJS, NPM
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y nodejs
# Install Yarn
RUN apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3 \
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update \
&& apt-get install -y yarn
# Install Grunt globally
RUN npm install -g grunt-cli
# Install Gulp globally
RUN npm install -g gulp-cli
# Install Bower globally
RUN npm install -g bower
# MariaDB
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db \
&& add-apt-repository 'deb [arch=amd64,i386] http://mirror.vpsfree.cz/mariadb/repo/10.1/debian jessie main'
RUN apt-get update \
&& apt-get install -y mariadb-server \
&& mysql_install_db
VOLUME /var/lib/mysql
ADD my.cnf /etc/mysql/conf.d/my.cnf
EXPOSE 3306
# Redis
RUN apt-get update \
&& apt-get install -y redis-server
EXPOSE 6379
# Clean
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/*