1
0

Switch to s6 instead of supervisor

Further reduces the images size from 100.2MB to 59.97MB
This commit is contained in:
Ruben Vermeersch 2016-07-28 14:07:39 +02:00
parent 1de5eb7a1d
commit 717fbe4264
5 changed files with 12 additions and 18 deletions

View File

@ -1,7 +1,7 @@
FROM alpine:3.4
MAINTAINER Christian Lück <christian@lueck.tv>
RUN apk add --update nginx supervisor php5-fpm php5-cli php5-curl php5-gd php5-json php5-dom php5-pcntl php5-posix \
RUN apk add --update nginx s6 php5-fpm php5-cli php5-curl php5-gd php5-json php5-dom php5-pcntl php5-posix \
php5-pgsql php5-mysql php5-mcrypt php5-pdo php5-pdo_pgsql php5-pdo_mysql ca-certificates && \
rm -rf /var/cache/apk/*
@ -30,5 +30,5 @@ ENV DB_PASS ttrss
# always re-configure database with current ENV when RUNning container, then monitor all services
ADD configure-db.php /configure-db.php
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD php /configure-db.php && supervisord -c /etc/supervisor/conf.d/supervisord.conf
ADD s6/ /etc/s6/
CMD php /configure-db.php && s6-svscan /etc/s6/

3
s6/nginx/run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/sbin/nginx

3
s6/php-fpm/run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/php-fpm --nodaemonize

3
s6/update-daemon/run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec s6-setuidgid nobody /usr/bin/php /var/www/update_daemon2.php

View File

@ -1,15 +0,0 @@
[supervisord]
nodaemon=true
[program:php-fpm]
command=/usr/bin/php-fpm --nodaemonize
[program:nginx]
command=/usr/sbin/nginx
[program:ttrss-update-daemon]
command=/usr/bin/php /var/www/update_daemon2.php
user=nobody
stdout_logfile=/tmp/%(program_name)s.stdout
stderr_logfile=/tmp/%(program_name)s.stderr