forked from dmstr/docker-php-yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-fpm
executable file
·108 lines (94 loc) · 3.56 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
# PHP Docker image for Yii 2.0 Framework runtime
# ==============================================
FROM php:7.0-fpm
# Install system packages for PHP extensions recommended for Yii 2.0 Framework
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
apt-key update && \
apt-get update && \
apt-get -y install \
g++ \
git \
libicu-dev \
libmcrypt-dev \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
zlib1g-dev \
mysql-client \
openssh-client \
libxml2-dev \
nano \
yui-compressor \
linkchecker \
nodejs \
--no-install-recommends && \
apt-get clean && \
npm -g install npm@latest && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install PHP extensions required for Yii 2.0 Framework
RUN 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 \
zip \
bcmath \
soap
# Install PECL extensions
# see http://stackoverflow.com/a/8154466/291573) for usage of `printf`
RUN printf "\n" | pecl install apcu-5.1.3 xdebug-stable && \
docker-php-ext-enable apcu
# Install less-compiler
RUN npm install -g less lesshint google-closure-compiler
ENV PHP_USER_ID=33 \
PHP_ENABLE_XDEBUG=0 \
VERSION_COMPOSER_MERGE_PLUGIN=^1.3.1 \
VERSION_COMPOSER_ASSET_PLUGIN=^1.2.0 \
VERSION_PRESTISSIMO_PLUGIN=^0.3.0 \
VERSION_CODECEPTION=^2.2.6 \
VERSION_YII2=^2.0.9 \
PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH \
TERM=linux \
COMPOSER_ALLOW_SUPERUSER=1
# Add configuration files
COPY image-files/ /
# Add GITHUB_API_TOKEN support for composer
ARG GITHUB_API_TOKEN
RUN echo "alias composer='composer.phar'" >> /root/.bashrc && \
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 \
"wikimedia/composer-merge-plugin:${VERSION_COMPOSER_MERGE_PLUGIN}" \
"fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}" \
"hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" && \
composer global dumpautoload --optimize
# Install CLI packages required for Yii 2.0 Framework globally
RUN composer global require --prefer-dist \
"codeception/codeception:${VERSION_CODECEPTION}" \
"codeception/specify:*" \
"codeception/verify:*" && \
composer global dumpautoload --optimize
# Install Yii 2.0 Framework libraries globally (for build caching)
RUN composer global require --prefer-dist \
"yiisoft/yii2:${VERSION_YII2}" \
"yiisoft/yii2-bootstrap" \
"yiisoft/yii2-codeception" \
"yiisoft/yii2-gii" \
"yiisoft/yii2-debug" && \
composer global dumpautoload --optimize
# TODO: this is a workaround
RUN composer config --global --unset github-oauth.github.com
WORKDIR /app
# Startup script for FPM
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["docker-run.sh"]