forked from dmstr/docker-php-yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-fpm
executable file
·111 lines (98 loc) · 3.76 KB
/
Dockerfile-fpm
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
# PHP Docker image for Yii 2.0 Framework runtime
# ==============================================
FROM php:7.1.9-fpm
# define build dependency lists
# inherited from PHP base image:
# PHPIZE_DEPS=autoconf dpkg-dev file g++ gcc libc-dev libpcre3-dev make pkg-config re2c
ENV CUSTOM_BUILD_DEPS \
unzip \
libmemcached-dev \
libicu-dev \
libmcrypt-dev \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libxml2-dev \
zlib1g-dev
# list of other packages which could be deinstalled at the end
ENV CUSTOM_REMOVE_LIST cpp \
cpp-4.9 \
g++-4.9 \
gcc-4.9 \
libgcc-4.9-dev \
libhashkit-dev \
libsasl2-dev \
libstdc++-4.9-dev
# Install system packages for PHP extensions recommended for Yii 2.0 Framework
# Install PHP extensions required for Yii 2.0 Framework
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
apt-key update && \
apt-get -y install \
$CUSTOM_BUILD_DEPS \
$PHPIZE_DEPS \
git \
mysql-client \
openssh-client \
nano \
linkchecker \
nodejs \
--no-install-recommends && \
npm -g install npm@latest && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
docker-php-ext-configure bcmath && \
docker-php-ext-install gd \
intl \
pdo_mysql \
mbstring \
mcrypt \
opcache \
zip \
bcmath \
soap && \
curl https://codeload.github.com/php-memcached-dev/php-memcached/zip/php7 -o /tmp/memcached.zip \
&& mkdir -p /usr/src/php/ext \
&& unzip /tmp/memcached.zip -d /usr/src/php/ext \
&& docker-php-ext-configure /usr/src/php/ext/php-memcached-php7 --disable-memcached-sasl \
&& docker-php-ext-install /usr/src/php/ext/php-memcached-php7 \
&& rm -rf /usr/src/php/ext/php-memcached-php7 /tmp/memcached.zip && \
printf "\n" | pecl install apcu-5.1.3 xdebug-stable && \
docker-php-ext-enable apcu && \
apt-get remove -y $PHPIZE_DEPS $CUSTOM_BUILD_DEPS $CUSTOM_REMOVE_LIST && \
dpkg --purge $(dpkg -l | awk '/^rc/ { print $2 }') && \
apt-get clean && \
rm -rf /usr/src/php* \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install less-compiler
RUN npm install -g \
less \
lesshint \
uglify-js \
uglifycss
ENV PHP_USER_ID=33 \
PHP_ENABLE_XDEBUG=0 \
VERSION_COMPOSER_ASSET_PLUGIN=^1.4.0 \
VERSION_PRESTISSIMO_PLUGIN=^0.3.7 \
PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH \
TERM=linux \
COMPOSER_ALLOW_SUPERUSER=1
# Add configuration files
COPY image-files/ /
RUN chmod 700 \
/usr/local/bin/docker-entrypoint.sh \
/usr/local/bin/docker-run.sh \
/usr/local/bin/composer
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer.phar \
--install-dir=/usr/local/bin && \
composer global require --optimize-autoloader \
"fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
"hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
composer global dumpautoload --optimize && \
composer clear-cache
WORKDIR /app
# Startup script for FPM
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["docker-run.sh"]