Commit a9a6acb1 authored by Jens Giessmann's avatar Jens Giessmann

switch process controll from forego to supervisor for nginx images

parent 3c7dcbdf
Pipeline #30271 passed with stages
in 2 minutes and 7 seconds
......@@ -21,8 +21,11 @@ Introduction
This is a Docker PHP image containing PHP extensions and composer packages and libraries for *Yii 2.0 Framework*.
It is primarily intended to build Yii 2.0 applications `FROM` this image, see below for available application templates.
There is also an `nginx` flavour available for this image, in which PHP and nginx are managed with forego.
There is also an `nginx` flavour available for this image, in which PHP and nginx are managed with [supervisor](http://supervisord.org/).
In older versions of the `nginx` images, forego was used for process control.
However, since forego is no longer actively maintained and problems can arise if one of the started processes terminates unsuspectedly,
we decided to switch to supervisor.
Features
--------
......
ARG PHP_IMAGE_VERSION
FROM dmstr/php-yii2:${PHP_IMAGE_VERSION}-alpine
# Install Forego
RUN curl -L -o /usr/local/bin/forego https://github.com/jwilder/forego/releases/download/v0.16.1/forego
RUN chmod u+x /usr/local/bin/forego
# Install nginx
RUN apk --update add nginx
RUN apk --update add nginx supervisor
# Add configuration files, Note: nginx runs under `www-data`
# Note: chmod is a workaround for esotheric permissions issues on Alpine
......@@ -19,6 +15,6 @@ RUN chown -R www-data:www-data /var/lib/nginx/ \
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
CMD ["forego", "start", "-r", "-f", "/root/Procfile"]
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
EXPOSE 80 443
\ No newline at end of file
ARG PHP_IMAGE_VERSION
FROM dmstr/php-yii2:${PHP_IMAGE_VERSION}
# Install Forego
RUN curl -L -o /usr/local/bin/forego https://github.com/jwilder/forego/releases/download/v0.16.1/forego
RUN chmod u+x /usr/local/bin/forego
# Install nginx
RUN apt-get update \
&& apt-get install -y --force-yes \
nginx-full \
cron \
supervisor \
procps \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
......@@ -22,6 +20,6 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& ln -sf /usr/sbin/cron /usr/sbin/crond
CMD ["forego", "start", "-r", "-f", "/root/Procfile"]
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
EXPOSE 80 443
[program:php-fpm]
command = php-fpm
autostart = true
autorestart = true
priority=40
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
[program:nginx]
command=/usr/sbin/nginx -g 'daemon off;'
autostart=true
autorestart=true
priority=50
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
[supervisord]
logfile = /dev/null
loglevel = info
pidfile = /var/run/supervisord.pid
nodaemon = true
[include]
files = /etc/supervisor/conf.d/*.conf
nginx: nginx -g 'daemon off;'
phpfpm: docker-run.sh
cron: crond -f
\ No newline at end of file
# forego is no longer used
# we now use supervisor for process control, see etc/supervisor/*.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment