Skip to content

Commit 61219d7

Browse files
committed
Merge branch 'release/3.0.0'
* release/3.0.0: Updated README Updated PHP5.4 with configurations Updated PHP5.3 with configurations Updated PHP5.6 container with configuration settings an example docker-compose.yml Added example docker-compose.yml file Updated PHP7.0 image with memcached/redis/imagick/apcu package installs. Added configuration vars
2 parents 1efb5de + 7b5b060 commit 61219d7

17 files changed

Lines changed: 185 additions & 74 deletions

5.3/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,17 @@ usr/sbin/locale-gen
6363

6464
RUN usermod -u 1000 www-data
6565

66+
EXPOSE 9000
67+
68+
ENV ENVIRONMENT dev
69+
ENV PHP_FPM_USER www-data
70+
ENV PHP_FPM_PORT 9000
71+
ENV PHP_ERROR_REPORTING "E_ALL \& ~E_NOTICE \& ~E_STRICT \& ~E_DEPRECATED"
72+
6673
COPY php.ini /etc/php5/fpm/conf.d/
6774
COPY php.ini /etc/php5/cli/conf.d/
6875
COPY www.conf /etc/php5/fpm/pool.d/
6976

70-
EXPOSE 9000
77+
COPY run.sh /run.sh
7178

72-
CMD ["/usr/sbin/php5-fpm", "--allow-to-run-as-root", "-c", "/etc/php5/fpm", "--nodaemonize"]
79+
ENTRYPOINT ["/bin/bash", "/run.sh"]

5.3/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
php:
2+
build: .
3+
working_dir: /var/www/app
4+
environment:
5+
PHP_FPM_USER: root
6+
PHP_FPM_PORT: 9000
7+
PHP_ERROR_REPORTING: E_ALL
8+
ENVIRONMENT: staging

5.3/run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
variables=( "PHP_FPM_USER" "PHP_FPM_PORT" "PHP_ERROR_REPORTING" "ENVIRONMENT" )
4+
5+
for var in "${variables[@]}"
6+
do
7+
:
8+
sed -i "s|%$var%|${!var}|g" /etc/php5/fpm/pool.d/www.conf
9+
done
10+
11+
/usr/sbin/php5-fpm --allow-to-run-as-root -c /etc/php5/fpm --nodaemonize

5.3/www.conf

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
[global]
2+
3+
error_log = /proc/self/fd/2
4+
daemonize = no
5+
16
[wwww]
27

3-
listen = 0.0.0.0:9000
8+
listen = 0.0.0.0:%PHP_FPM_PORT%
49

5-
listen.owner = www-data
6-
listen.group = www-data
10+
listen.owner = %PHP_FPM_USER%
11+
listen.group = %PHP_FPM_USER%
712

813
listen.mode = 0666
914

@@ -14,12 +19,13 @@ pm.max_requests = 200
1419

1520
chdir = /
1621

17-
user = www-data
18-
group = www-data
22+
user = %PHP_FPM_USER%
23+
group = %PHP_FPM_USER%
1924

2025
php_flag[log_errors] = True
2126
php_value[display_errors] = False
2227
php_value[error_log] = /var/log/error.log
2328
php_value[memory_limit] = 2048M
24-
php_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
25-
env[ENVIRONMENT] = dev
29+
php_value[error_reporting] = %PHP_ERROR_REPORTING%
30+
env[ENVIRONMENT] = %ENVIRONMENT%
31+

5.4/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@ usr/sbin/locale-gen
5757

5858
RUN usermod -u 1000 www-data
5959

60+
EXPOSE 9000
61+
62+
ENV ENVIRONMENT dev
63+
ENV PHP_FPM_USER www-data
64+
ENV PHP_FPM_PORT 9000
65+
ENV PHP_ERROR_REPORTING "E_ALL \& ~E_NOTICE \& ~E_STRICT \& ~E_DEPRECATED"
66+
6067
COPY php.ini /etc/php5/fpm/conf.d/
6168
COPY php.ini /etc/php5/cli/conf.d/
6269
COPY www.conf /etc/php5/fpm/pool.d/
6370

64-
EXPOSE 9000
71+
COPY run.sh /run.sh
6572

66-
CMD ["/usr/sbin/php5-fpm", "--allow-to-run-as-root", "-c", "/etc/php5/fpm", "--nodaemonize"]
73+
ENTRYPOINT ["/bin/bash", "/run.sh"]

5.4/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
php:
2+
build: .
3+
working_dir: /var/www/app
4+
environment:
5+
PHP_FPM_USER: root
6+
PHP_FPM_PORT: 9000
7+
PHP_ERROR_REPORTING: E_ALL
8+
ENVIRONMENT: staging

5.4/run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
variables=( "PHP_FPM_USER" "PHP_FPM_PORT" "PHP_ERROR_REPORTING" "ENVIRONMENT" )
4+
5+
for var in "${variables[@]}"
6+
do
7+
:
8+
sed -i "s|%$var%|${!var}|g" /etc/php5/fpm/pool.d/www.conf
9+
done
10+
11+
/usr/sbin/php5-fpm --allow-to-run-as-root -c /etc/php5/fpm --nodaemonize

5.4/www.conf

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
[global]
2+
3+
error_log = /proc/self/fd/2
4+
daemonize = no
5+
16
[wwww]
27

3-
listen = 0.0.0.0:9000
8+
listen = 0.0.0.0:%PHP_FPM_PORT%
49

5-
listen.owner = www-data
6-
listen.group = www-data
10+
listen.owner = %PHP_FPM_USER%
11+
listen.group = %PHP_FPM_USER%
712

813
listen.mode = 0666
914

@@ -14,12 +19,13 @@ pm.max_requests = 200
1419

1520
chdir = /
1621

17-
user = www-data
18-
group = www-data
22+
user = %PHP_FPM_USER%
23+
group = %PHP_FPM_USER%
1924

2025
php_flag[log_errors] = True
2126
php_value[display_errors] = False
2227
php_value[error_log] = /var/log/error.log
2328
php_value[memory_limit] = 2048M
24-
php_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
25-
env[ENVIRONMENT] = dev
29+
php_value[error_reporting] = %PHP_ERROR_REPORTING%
30+
env[ENVIRONMENT] = %ENVIRONMENT%
31+

5.6/Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
FROM debian:jessie
22

3-
ENV ENVIRONMENT dev
4-
53
RUN \
64
apt-get update && \
75
apt-get install -y \
@@ -60,10 +58,17 @@ usr/sbin/locale-gen
6058

6159
RUN usermod -u 1000 www-data
6260

61+
EXPOSE 9000
62+
63+
ENV ENVIRONMENT dev
64+
ENV PHP_FPM_USER www-data
65+
ENV PHP_FPM_PORT 9000
66+
ENV PHP_ERROR_REPORTING "E_ALL \& ~E_NOTICE \& ~E_STRICT \& ~E_DEPRECATED"
67+
6368
COPY php.ini /etc/php5/fpm/conf.d/
6469
COPY php.ini /etc/php5/cli/conf.d/
6570
COPY www.conf /etc/php5/fpm/pool.d/
6671

67-
EXPOSE 9000
72+
COPY run.sh /run.sh
6873

69-
CMD ["/usr/sbin/php5-fpm", "--allow-to-run-as-root", "-c", "/etc/php5/fpm", "--nodaemonize"]
74+
ENTRYPOINT ["/bin/bash", "/run.sh"]

5.6/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
php:
2+
build: .
3+
working_dir: /var/www/app
4+
environment:
5+
PHP_FPM_USER: root
6+
PHP_FPM_PORT: 9000
7+
PHP_ERROR_REPORTING: E_ALL
8+
ENVIRONMENT: staging

0 commit comments

Comments
 (0)