Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
docker-php-yii2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
docker-php-yii2
Commits
a9a6acb1
Commit
a9a6acb1
authored
Jun 26, 2018
by
Jens Giessmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch process controll from forego to supervisor for nginx images
parent
3c7dcbdf
Pipeline
#30271
passed with stages
in 2 minutes and 7 seconds
Changes
7
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
15 deletions
+40
-15
README.md
README.md
+4
-1
Dockerfile-fpm-alpine-nginx
nginx/Dockerfile-fpm-alpine-nginx
+2
-6
Dockerfile-fpm-nginx
nginx/Dockerfile-fpm-nginx
+3
-5
fpm.conf
nginx/image-files/etc/supervisor/conf.d/fpm.conf
+9
-0
nginx.conf
nginx/image-files/etc/supervisor/conf.d/nginx.conf
+11
-0
supervisord.conf
nginx/image-files/etc/supervisor/supervisord.conf
+9
-0
Procfile
nginx/image-files/root/Procfile
+2
-3
No files found.
README.md
View file @
a9a6acb1
...
...
@@ -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
--------
...
...
nginx/Dockerfile-fpm-alpine-nginx
View file @
a9a6acb1
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
nginx/Dockerfile-fpm-nginx
View file @
a9a6acb1
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
nginx/image-files/etc/supervisor/conf.d/fpm.conf
0 → 100644
View file @
a9a6acb1
[
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
nginx/image-files/etc/supervisor/conf.d/nginx.conf
0 → 100644
View file @
a9a6acb1
[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
nginx/image-files/etc/supervisor/supervisord.conf
0 → 100644
View file @
a9a6acb1
[
supervisord
]
logfile
= /
dev
/
null
loglevel
=
info
pidfile
= /
var
/
run
/
supervisord
.
pid
nodaemon
=
true
[
include
]
files
= /
etc
/
supervisor
/
conf
.
d
/*.
conf
nginx/image-files/root/Procfile
View file @
a9a6acb1
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/*.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment