-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-debian.template
46 lines (43 loc) · 2.03 KB
/
Dockerfile-debian.template
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
FROM php:%%PHP_TAG%%
MAINTAINER Jorge Matricali <[email protected]>
ENV PHALCON_VERSION %%PHALCON_VERSION%%
ENV PHALCON_URL %%PHALCON_URL%%
ENV PHPUNIT_VERSION %%PHPUNIT_VERSION%%
RUN set -x && \
apt-get update && \
# Install dependencies
apt-get install --no-install-recommends --no-install-suggests -y git unzip libpng-dev libpng16-16 && \
# Build and install PHP extensions
docker-php-ext-install -j$(nproc) pdo && \
docker-php-ext-install -j$(nproc) pdo_mysql && \
docker-php-ext-install -j$(nproc) bcmath && \
docker-php-ext-install -j$(nproc) gd && \
yes | pecl install %%PHP_XDEBUG_PACKAGE%% && \
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini && \
echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini && \
echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini && \
# Build and install Phalcon extension
cd /tmp/ && \
curl -O "${PHALCON_URL}" && \
tar xvzf "v${PHALCON_VERSION}" && rm "v${PHALCON_VERSION}" && \
cd "cphalcon-${PHALCON_VERSION}/build" && \
./install && \
docker-php-ext-enable phalcon && \
# Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
php -r "unlink('composer-setup.php');" && \
# PHPUnit
curl -L "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" > /usr/bin/phpunit && \
chmod a+x /usr/bin/phpunit && \
# MongoDB
apt-get install --no-install-recommends --no-install-suggests -y libcurl4-openssl-dev libssl-dev pkg-config && \
pecl install mongodb && \
docker-php-ext-enable mongodb && \
# Eliminar cosas que ya no necesitamos :D
apt-get remove --purge --auto-remove -y libpng-dev libcurl4-openssl-dev libssl-dev pkg-config && \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt-get clean -y && \
rm -fr /var/lib/apt/lists/* && \
rm -fr /tmp/* /var/tmp/*