forked from ezsystems/ezpublish-docker
/
Dockerfile-dev
85 lines (67 loc) · 2.66 KB
/
Dockerfile-dev
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
FROM debian:jessie
# Container containing php-fpm and php-cli to run and interact with eZ Platform
#
# It has two modes of operation:
# - (default run.sh cmd) Reconfigure eZ Platform/Publish based on provided env variables and start php-fpm
# - (bash|php|composer) Allows to execute composer, php or bash against the install
# Set defaults for variables used by run.sh
# If you change MAX_EXECUTION TIME, also change fastcgi_read_timeout accordingly in nginx!
ENV DEBIAN_FRONTEND=noninteractive \
TIMEZONE=Europe/Warsaw \
MEMORY_LIMIT=512M \
MAX_EXECUTION_TIME=180 \
PORT=9000 \
COMPOSER_HOME=/var/.composer
RUN apt-get update -q -y && apt-get install -q -y --force-yes --no-install-recommends \
php5-cli \
php5-readline \
php5-fpm \
php5-mysqlnd \
php5-json \
php5-xsl \
php5-intl \
php5-mcrypt \
php5-gd \
php5-curl \
php5-twig \
php5-xdebug \
imagemagick \
curl \
wget \
ca-certificates \
vim \
git \
acl \
tree \
&& rm -rf /var/lib/apt/lists/*
# Create Composer directory (cache and auth files)
RUN mkdir -p $COMPOSER_HOME
# Set timezone
RUN echo $TIMEZONE > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
RUN sed -i "s@^;date.timezone =.*@date.timezone = $TIMEZONE@" /etc/php5/*/php.ini
# Set memory limit
RUN sed -i "s@^memory_limit =.*@memory_limit = $MEMORY_LIMIT@" /etc/php5/fpm/php.ini
# Increase realpath_cache_size
RUN sed -i "s@^;realpath_cache_size =.*@realpath_cache_size = 128k@" /etc/php5/fpm/php.ini
# Set Max execution time
RUN sed -i "s@^max_execution_time = .*@max_execution_time = $MAX_EXECUTION_TIME@" /etc/php5/fpm/php.ini
# Enable all error reporting
RUN sed -i "s@^error_reporting = .*@error_reporting = E_ALL@" /etc/php5/*/php.ini
# Set FPM Debug level
RUN sed -i "s@^;log_level = notice@log_level = debug@" /etc/php5/fpm/php-fpm.conf
# Disable daemonizeing php-fpm
RUN sed -i "s@^;daemonize = yes*@daemonize = no@" /etc/php5/fpm/php-fpm.conf
# Set listen socket for php-fpm
RUN sed -i "s@^listen = /var/run/php5-fpm.sock@listen = $PORT@" /etc/php5/fpm/pool.d/www.conf
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin && mv /usr/local/bin/composer.phar /usr/local/bin/composer
# As application is put in as volume we do all needed operation on run
ADD run.sh /run.sh
ADD generate_kickstart_file.sh /generate_kickstart_file.sh
ADD kickstart_template.ini /kickstart_template.ini
ADD generate_parameters_file.sh /generate_parameters_file.sh
ADD config/opcache.ini /etc/php5/mods-available/opcache.ini
ADD config/xdebug.ini /etc/php5/mods-available/xdebug.ini
RUN chmod 755 /*.sh
WORKDIR /var/www
CMD /run.sh
EXPOSE 9000 9001