delete all root process

This commit is contained in:
Wonderfall
2016-09-16 17:08:06 +02:00
parent c34874716a
commit 9cbccd93dc
69 changed files with 183 additions and 224 deletions

View File

@ -18,7 +18,6 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& apk -U add \
${BUILD_DEPS} \
nginx \
libwebp \
php7-mbstring@commuedge \
php7-fpm@commuedge \
php7-exif@commuedge \
@ -29,7 +28,8 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
php7-session@commuedge \
php7-pear@commuedge \
php7-dev@commuedge \
supervisor \
s6 \
su-exec \
imagemagick \
tini@commuedge \
&& sed -i -e "s/max_execution_time = 30/max_execution_time = 200/g" \
@ -48,11 +48,13 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm.conf /etc/php7/php-fpm.conf
COPY supervisord.conf /usr/local/etc/supervisord.conf
COPY s6.d /etc/s6.d
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/*
VOLUME /lychee/uploads /lychee/data
EXPOSE 80
CMD ["/sbin/tini","--","run.sh"]
EXPOSE 8888
CMD ["run.sh"]

View File

@ -23,4 +23,4 @@ Lychee is a free photo-management tool, which runs on your server or web-space.
- **/lychee/data** : data files.
#### Ports
- **80** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)
- **8888** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)

View File

@ -1,6 +1,5 @@
user lychee;
worker_processes auto;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
daemon off;
events {
@ -47,10 +46,10 @@ http {
image/svg+xml;
server {
listen 80;
root /lychee;
index index.php index.html;
client_max_body_size 100M;
listen 8888;
root /lychee;
index index.php index.html;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.html;
@ -65,7 +64,7 @@ http {
location ~ \.php$ {
fastcgi_split_path_info ^(.*\.php)(/.*)?$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

View File

@ -2,11 +2,7 @@
daemonize = no
[www]
user = lychee
group = lychee
listen = /var/run/php-fpm.sock
listen.owner = lychee
listen.group = lychee
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 5
pm.start_servers = 2

View File

@ -1,5 +1,4 @@
#!/bin/sh
addgroup -g ${GID} lychee && adduser -h /lychee -s /bin/sh -D -G lychee -u ${UID} lychee
mkdir /lychee/uploads/big /lychee/uploads/import /lychee/uploads/medium /lychee/uploads/thumb
chown -R lychee:lychee /lychee /var/run/php-fpm.sock /var/lib/nginx /tmp
exec supervisord -c /usr/local/etc/supervisord.conf
chown -R $UID:$GID /lychee /etc/nginx /etc/php7 /var/log /var/lib/nginx /tmp /etc/s6.d
exec su-exec $UID:$GID /sbin/tini -- /bin/s6-svscan /etc/s6.d

2
lychee/s6.d/nginx/run Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec nginx

2
lychee/s6.d/php/run Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec php-fpm7

View File

@ -1,8 +0,0 @@
[supervisord]
nodaemon=true
[program:php-fpm]
command=php-fpm7
[program:nginx]
command=nginx