-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
56 lines (45 loc) · 2 KB
/
Dockerfile
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
FROM php:5.6.18-fpm
MAINTAINER haertl.mike@gmail.com
ENV PATH $PATH:/root/.composer/vendor/bin
# PHP extensions come first, as they are less likely to change between Yii releases
RUN apt-get update \
&& apt-get -y install \
git \
g++ \
libicu-dev \
libmcrypt-dev \
zlib1g-dev \
--no-install-recommends \
# Install PHP extensions
&& docker-php-ext-install intl \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mcrypt \
&& docker-php-ext-install opcache \
&& docker-php-ext-install zip \
&& pecl install apcu-4.0.11 && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \
&& apt-get purge -y g++ \
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/* \
# Don't clear our valuable environment vars in PHP
&& echo "\nclear_env = no" >> /usr/local/etc/php-fpm.conf \
# Fix write permissions with shared folders
&& usermod -u 1000 www-data
# Next composer and global composer package, as their versions may change from time to time
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer.phar \
&& composer.phar global require --no-progress "fxp/composer-asset-plugin:~1.4.2" \
&& composer.phar global require --no-progress "codeception/codeception=2.0.*" \
&& composer.phar global require --no-progress "codeception/specify=*" \
&& composer.phar global require --no-progress "codeception/verify=*"
# Nginx example config and composer wrapper
COPY nginx /opt/nginx
COPY composer /usr/local/bin/composer
WORKDIR /var/www/html
# Composer packages are installed outside the app directory /var/www/html.
# This way developers can mount the source code from their host directory
# into /var/www/html and won't end up with an empty vendors/ directory.
COPY composer.json /var/www/html/
COPY composer.lock /var/www/html/
RUN composer install --prefer-dist --no-progress \
&& rm composer.*