22# ==============================================
33
44ARG PHP_BASE_IMAGE_VERSION
5- FROM php:${PHP_BASE_IMAGE_VERSION}-fpm
5+ FROM yiisoftware/yii2- php:${PHP_BASE_IMAGE_VERSION}-fpm
66
77# Install system packages for PHP extensions recommended for Yii 2.0 Framework
88ENV DEBIAN_FRONTEND=noninteractive
@@ -13,72 +13,14 @@ RUN apt-get update && \
1313 apt-key update && \
1414 apt-get update && \
1515 apt-get -y install \
16- g++ \
1716 git \
18- bash-completion \
19- curl \
20- imagemagick \
21- libfreetype6-dev \
22- libcurl3-dev \
23- libicu-dev \
24- libfreetype6-dev \
25- libjpeg-dev \
26- libjpeg62-turbo-dev \
27- libmagickwand-dev \
28- libpq-dev \
29- libpng-dev \
30- libzip-dev \
31- zlib1g-dev \
32- default-mysql-client \
33- openssh-client \
34- libxml2-dev \
3517 nano \
3618 npm \
3719 --no-install-recommends && \
3820 apt-get clean && \
3921 npm -g install npm@latest && \
4022 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4123
42- # Install PHP extensions required for Yii 2.0 Framework
43- RUN docker-php-ext-configure gd \
44- --with-freetype-dir=/usr/include/ \
45- --with-png-dir=/usr/include/ \
46- --with-jpeg-dir=/usr/include/ && \
47- docker-php-ext-configure bcmath && \
48- docker-php-ext-install \
49- soap \
50- zip \
51- curl \
52- bcmath \
53- exif \
54- gd \
55- iconv \
56- intl \
57- mbstring \
58- opcache \
59- pdo_mysql \
60- pdo_pgsql
61-
62- # Install PECL extensions
63- # see http://stackoverflow.com/a/8154466/291573) for usage of `printf`
64- RUN printf "\n" | pecl install \
65- apcu-5.1.14 \
66- imagick && \
67- docker-php-ext-enable \
68- apcu \
69- imagick
70-
71- # Install xdebug
72- RUN cd /tmp && \
73- git clone git://github.com/xdebug/xdebug.git && \
74- cd xdebug && \
75- git checkout tags/2.8.0 && \
76- phpize && \
77- ./configure --enable-xdebug && \
78- make && \
79- make install && \
80- rm -rf /tmp/xdebug
81-
8224# Install less-compiler
8325RUN npm install -g \
8426 less \
@@ -90,14 +32,6 @@ RUN npm install -g \
9032RUN curl -L https://raw.githubusercontent.com/yiisoft/yii2/master/contrib/completion/bash/yii \
9133 -o /etc/bash_completion.d/yii
9234
93- ENV PHP_USER_ID=33 \
94- PHP_ENABLE_XDEBUG=0 \
95- VERSION_COMPOSER_ASSET_PLUGIN=^1.4.3 \
96- VERSION_PRESTISSIMO_PLUGIN=^0.3.0 \
97- PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH \
98- TERM=linux \
99- COMPOSER_ALLOW_SUPERUSER=1
100-
10135# Add configuration files
10236COPY image-files/ /
10337
@@ -107,16 +41,6 @@ RUN chmod 700 \
10741 /usr/local/bin/docker-run.sh \
10842 /usr/local/bin/composer
10943
110- # Install composer
111- RUN curl -sS https://getcomposer.org/installer | php -- \
112- --filename=composer.phar \
113- --install-dir=/usr/local/bin && \
114- composer global require --optimize-autoloader \
115- "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
116- "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
117- composer global dumpautoload --optimize && \
118- composer clear-cache
119-
12044WORKDIR /app
12145
12246# Startup script for FPM
0 commit comments