Skip to content

Commit

Permalink
Merge pull request appserver-io#1052 from wagnert/master
Browse files Browse the repository at this point in the history
Fixed invalid user/group for PHP-FPM in Dockerfile + Add MySQL instal…
  • Loading branch information
wagnert authored Apr 27, 2017
2 parents 6887b22 + 377e8d5 commit 5706531
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 1.1.4-beta8

## Bugfixes

* Fixed invalid user/group for PHP-FPM in Dockerfile

## Features

* Allow PHP-FPM execution via supervicsor as root
* Add MySQL installation to Dockerfile

# Version 1.1.4-beta7

## Bugfixes
Expand Down
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ MAINTAINER Tim Wagner <tw@appserver.io>
ENV APPSERVER_RUNTIME_BUILD_VERSION 1.1.6-44

# update the sources list
RUN apt-get update \
RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5 \

# add the MySQL repository to the sources list
&& echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-5.6" >> /etc/apt/sources.list.d/mysql.list \

# update the sources list
&& apt-get update \

# install the necessary packages
&& DEBIAN_FRONTEND=noninteractive apt-get install supervisor wget git -y python-pip \
&& DEBIAN_FRONTEND=noninteractive apt-get install supervisor wget git mysql-server -y python-pip \

# install the Python package to redirect the supervisord output
&& pip install supervisor-stdout
Expand Down Expand Up @@ -61,6 +67,10 @@ RUN ln -s /opt/appserver/bin/composer.phar /usr/local/bin/composer \
# modify user-rights in configuration
&& sed -i "s/www-data/root/g" etc/appserver/appserver.xml \

# replace the default user/group for the PHP-FPM configuration
&& sed -i "s/user = www-data/user = root/g" etc/php-fpm.conf \
&& sed -i "s/group = www-data/group = root/g" etc/php-fpm.conf \

# modify system logger configuration
&& sed -i "s/var\/log\/appserver-errors.log/php:\/\/stderr/g" etc/appserver/appserver.xml \

Expand All @@ -84,6 +94,7 @@ RUN ln -s /opt/appserver/bin/composer.phar /usr/local/bin/composer \

# modify the error_log of PHP-FPM php.ini to /dev/stderr
&& sed -i "s/\/opt\/appserver\/var\/log\/php-fpm-fcgi_errors.log/\/proc\/self\/fd\/2/g" etc/php-fpm-fcgi.ini \
&& sed -i "s/;always_populate_raw_post_data = On/always_populate_raw_post_data = -1/g" etc/php-fpm-fcgi.ini \

# create a symlink to the supervisord configuration file
&& ln -s /opt/appserver/etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
Expand Down
9 changes: 8 additions & 1 deletion etc/supervisor/conf.d/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stderr_events_enabled=true

[program:appserver-php5-fpm]
directory = /opt/appserver
command = sbin/php-fpm -F --php-ini /opt/appserver/etc/php-fpm-fcgi.ini --fpm-config /opt/appserver/etc/php-fpm.conf
command = sbin/php-fpm -R -F --php-ini /opt/appserver/etc/php-fpm-fcgi.ini --fpm-config /opt/appserver/etc/php-fpm.conf
user = root
autostart = true
stdout_events_enabled=true
Expand All @@ -25,6 +25,13 @@ autostart = true
stdout_events_enabled=true
stderr_events_enabled=true

[program:mysqld]
command = mysqld
user = root
autostart = true
stdout_events_enabled=true
stderr_events_enabled=true

[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 10
Expand Down

0 comments on commit 5706531

Please sign in to comment.