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

@ -1,7 +1,7 @@
FROM alpine:3.4
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ENV GID=991 UID=991
ENV UID=991 GID=991
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
@ -9,13 +9,12 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& apk -U add \
${BUILD_DEPS} \
nginx \
supervisor \
s6 \
openssl \
ca-certificates \
libsmbclient \
samba-client \
su-exec \
tini@commuedge \
php7@commuedge \
php7-fpm@commuedge \
php7-intl@commuedge \
@ -54,18 +53,18 @@ COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm.conf /etc/php7/php-fpm.conf
COPY opcache.ini /etc/php7/conf.d/00_opcache.ini
COPY apcu.ini /etc/php7/conf.d/apcu.ini
COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY run.sh /usr/local/bin/run.sh
COPY occ /usr/local/bin/occ
COPY cron /etc/periodic/15min/nextcloud
COPY s6.d /etc/s6.d
RUN chmod +x /usr/local/bin/* /etc/periodic/15min/nextcloud
RUN chmod +x /usr/local/bin/* /etc/periodic/15min/nextcloud /etc/s6.d/*/*
VOLUME /data /config /apps2
EXPOSE 80
EXPOSE 8888
LABEL description="A server software for creating file hosting services" \
nextcloud="Nextcloud daily build"
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -1,2 +1,2 @@
#!/bin/sh
su - nextcloud -c "php7 -f /nextcloud/cron.php" > /dev/null 2>&1
php7 -f /nextcloud/cron.php" > /dev/null 2>&1

View File

@ -1,6 +1,5 @@
user nextcloud;
worker_processes auto;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
daemon off;
events {
@ -50,7 +49,7 @@ http {
image/svg+xml;
server {
listen 80;
listen 8888;
index index.php;
root /nextcloud;
client_max_body_size 10G;
@ -94,7 +93,7 @@ http {
fastcgi_param modHeadersAvailable true;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_pass unix:/tmp/php-fpm.sock;
}
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {

View File

@ -2,11 +2,7 @@
daemonize = no
[www]
user = nextcloud
group = nextcloud
listen = /var/run/php-fpm.sock
listen.owner = nextcloud
listen.group = nextcloud
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
@ -19,3 +15,4 @@ php_admin_value[post_max_size] = 10G
php_admin_value[upload_max_filesize] = 10G
php_admin_value[max_execution_time] = 10800
php_admin_value[max_input_time] = 1200

View File

@ -1,15 +1,12 @@
#!/bin/sh
addgroup -g ${GID} nextcloud && adduser -h /nextcloud -s /bin/sh -D -G nextcloud -u ${UID} nextcloud
# Set default data directory
if [ ! -f /config/config.php ]; then
echo -e "<?php\n\$CONFIG = array (\n 'datadirectory' => '/data',\n);" > /config/config.php
fi
touch /var/run/php-fpm.sock
mkdir /tmp/fastcgi /tmp/client_body
chown -R nextcloud:nextcloud /nextcloud /data /config /apps2 /var/run/php-fpm.sock /var/lib/nginx /tmp
chown -R $UID:$GID /nextcloud /data /config /apps2 /etc/nginx /etc/php7 /var/log/nginx /var/log/php7 /var/lib/nginx /tmp /etc/s6.d
ln -s /config/config.php /nextcloud/config/config.php
ln -s /apps2 /nextcloud
exec supervisord -c /etc/supervisor/supervisord.conf
exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d

View File

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

View File

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

View File

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

View File

@ -1,11 +0,0 @@
[supervisord]
nodaemon=true
[program:cron]
command=crond -f
[program:php-fpm]
command=php-fpm7
[program:nginx]
command=nginx