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,9 +1,13 @@
FROM alpine:3.4
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG BOINC_USER_ID=35854
ARG BUILD_CORES
RUN BUILD_DEPS=" \
ENV UID=991 GID=991
RUN echo "@community https://nl.alpinelinux.org/alpine/v3.4/community" >> /etc/apk/repositories \
&& NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} \
&& BUILD_DEPS=" \
build-base \
git \
m4 \
@ -14,6 +18,8 @@ RUN BUILD_DEPS=" \
libnotify-dev" \
&& apk -U add \
${BUILD_DEPS} \
su-exec \
tini@community \
libnotify \
libstdc++ \
curl \
@ -22,13 +28,15 @@ RUN BUILD_DEPS=" \
&& cd boinc \
&& ./_autosetup \
&& ./configure --disable-server --enable-client CXXFLAGS="-O3 " \
&& make \
&& make -j ${NB_CORES} \
&& make install \
&& adduser -h /home/boinc -D -s /sbin/nologin -u ${BOINC_USER_ID} boinc \
&& apk del ${BUILD_DEPS} \
&& rm -rf /var/cache/apk/* /tmp/*
USER boinc
WORKDIR /home/boinc
VOLUME /home/boinc
ENTRYPOINT [ "boinc" ]
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
VOLUME /boinc
CMD ["run.sh"]

3
boinc/run.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
chown -R $UID:$GID /boinc && cd /boinc
exec su-exec $UID:$GID /sbin/tini -- boinc

View File

@ -115,4 +115,4 @@ LABEL description="Secure nginx built from source." \
openssl="BoringSSL (date of the container)." \
nginx="nginx ${NGINX_VERSION}."
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -1,4 +1,4 @@
#!/bin/sh
chown -R $UID:$GID /etc/nginx /var/log/nginx /var/run/nginx.pid /sites-enabled /conf.d /certs /www /tmp
chmod -R 700 /certs
su-exec $UID:$GID nginx
exec su-exec $UID:$GID /sbin/tini -- nginx

View File

@ -80,5 +80,7 @@ COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
VOLUME /cowrie/log /cowrie/dl /cowrie/custom
EXPOSE 2222
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -15,4 +15,4 @@ mkdir -p /cowrie/log/tty
cp -R /cowrie/custom/* /cowrie
chown -R $UID:$GID /cowrie
su-exec $UID:$GID twistd -n -l /cowrie/log/cowrie.log cowrie
exec su-exec $UID:$GID /sbin/tini -- twistd -n -l /cowrie/log/cowrie.log cowrie

View File

@ -1,5 +1,5 @@
FROM wonderfall/node:stable
MAINTAINER Wonderfall <wonderfall@mondedie.fr>
FROM xataz/node:6
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG VERSION=0.10.1
@ -63,4 +63,4 @@ EXPOSE 2368
LABEL description="Ghost CMS ready for production" \
ghost="Ghost v$VERSION"
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -55,4 +55,4 @@ if [ "$SYNTAX_HIGHLIGHTING" == "True" ] && [ ! -f /ghost/content/themes/casper/a
fi
chown -R $UID:$GID /ghost && cd /ghost
su-exec $UID:$GID npm start --production
exec su-exec $UID:$GID tini -- npm start --production

View File

@ -28,8 +28,11 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& rm -rf /var/cache/apk/* /tmp/*
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
EXPOSE 8080
VOLUME /db /config
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -1,3 +1,3 @@
#!/bin/sh
chown -R $UID:$GID /db /config
su-exec $UID:$GID isso -c /config/isso.conf run
exec su-exec $UID:$GID /sbin/tini -- isso -c /config/isso.conf run

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

View File

@ -4,7 +4,7 @@ MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG NEXTCLOUD_VERSION=10.0.0
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
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 \
@ -12,13 +12,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 \
@ -70,18 +69,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 v${NEXTCLOUD_VERSION}"
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

@ -1,2 +1,2 @@
#!/bin/sh
su-exec nextcloud:nextcloud php7 /nextcloud/occ $@
su-exec $UID:$GID php7 /nextcloud/occ $@

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

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

View File

@ -4,7 +4,7 @@ MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG NEXTCLOUD_VERSION=9.0.53
ARG GPG_nextcloud="2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A"
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 \
@ -12,13 +12,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 \
@ -70,18 +69,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 v${NEXTCLOUD_VERSION}"
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

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

View File

@ -30,7 +30,7 @@
- **GID** : nextcloud group id *(default : 991)*
#### Port
- **80**.
- **8888** (recently changed, nginx now runs without root)
#### Volumes
- **/data** : Nextcloud data.

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

View File

@ -121,4 +121,4 @@ LABEL description="nginx built from source." \
openssl="LibreSSL ${LIBRESSL_VERSION}." \
nginx="nginx ${NGINX_VERSION}."
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -1,5 +1,4 @@
#!/bin/sh
touch /var/run/nginx.pid
chown -R $UID:$GID /etc/nginx /var/log/nginx /var/run/nginx.pid /sites-enabled /conf.d /certs /www /tmp
chmod -R 700 /certs
su-exec $UID:$GID nginx
exec su-exec $UID:$GID /sbin/tini -- nginx

View File

@ -8,7 +8,8 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& apk -U add \
$BUILD_DEPS \
nginx \
supervisor \
s6 \
su-exec \
tini@commuedge \
php7-fpm@commuedge \
php7-gd@commuedge \
@ -23,13 +24,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 run.sh /usr/local/bin/run.sh
COPY s6.d /etc/s6.d
RUN chmod +x /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/*
VOLUME /zerobin/data
EXPOSE 80
EXPOSE 8888
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -15,4 +15,4 @@ Paste securely.
- **/zerobin/data**
#### 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 zerobin;
worker_processes auto;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
daemon off;
events {
@ -47,7 +46,7 @@ http {
image/svg+xml;
server {
listen 80;
listen 8888;
root /zerobin;
index index.php index.html;
@ -74,7 +73,7 @@ http {
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

View File

@ -1,9 +1,5 @@
[www]
user = zerobin
group = zerobin
listen = /var/run/php-fpm.sock
listen.owner = zerobin
listen.group = zerobin
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 5
pm.start_servers = 2

View File

@ -1,5 +1,3 @@
#!/bin/sh
addgroup -g ${GID} zerobin && adduser -h /zerobin -s /bin/sh -D -G zerobin -u ${UID} zerobin
touch /var/run/php-fpm.sock
chown -R zerobin:zerobin /zerobin /var/run/php-fpm.sock /var/lib/nginx /tmp
exec supervisord -c /usr/local/etc/supervisord.conf
chown -R $UID:$GID /zerobin /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

View File

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

2
privatebin/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 --nodaemonize
[program:nginx]
command=nginx

View File

@ -3,13 +3,14 @@ MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG GPG_rainloop="3B79 7ECE 694F 3B7B 70F3 11A4 ED7C 49D9 87DA 4591"
ENV GID=991 UID=991
ENV UID=991 GID=991
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk -U add \
gnupg \
nginx \
supervisor \
s6 \
su-exec \
tini@commuedge \
php7-fpm@commuedge \
php7-curl@commuedge \
@ -41,11 +42,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 /rainloop/data
EXPOSE 80
CMD ["/sbin/tini","--","run.sh"]
EXPOSE 8888
CMD ["run.sh"]

View File

@ -11,7 +11,6 @@ Rainloop is a simple, modern & fast web-based client. More info on the [official
- Contacts (DB) : sqlite, or mysql (server not built-in)
- nginx + PHP7
#### Build-time variables
- **GPG_rainloop** : fingerprint of signing key
@ -22,6 +21,9 @@ Rainloop is a simple, modern & fast web-based client. More info on the [official
#### Volumes
- **/rainloop/data** : data files.
#### Ports
- **8888***
#### Reverse proxy
https://github.com/Wonderfall/dockerfiles/tree/master/reverse
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration

View File

@ -1,6 +1,5 @@
user rainloop;
worker_processes auto;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
daemon off;
events {
@ -47,9 +46,9 @@ http {
image/svg+xml;
server {
listen 80;
root /rainloop;
index index.php index.html;
listen 8888;
root /rainloop;
index index.php index.html;
location ^~ /data {
deny all;
@ -61,7 +60,7 @@ http {
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

View File

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

View File

@ -1,4 +1,3 @@
#!/bin/sh
addgroup -g ${GID} rainloop && adduser -h /rainloop -s /bin/sh -D -G rainloop -u ${UID} rainloop
chown -R rainloop:rainloop /rainloop /var/run/php-fpm.sock /var/lib/nginx /tmp
exec supervisord -c /usr/local/etc/supervisord.conf
chown -R $UID:$GID /rainloop /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
rainloop/s6.d/nginx/run Normal file
View File

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

2
rainloop/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

View File

@ -1,7 +1,8 @@
FROM alpine:3.4
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ENV BASE_URL=False IMAGE_PROXY=False
ENV BASE_URL=False IMAGE_PROXY=False \
UID=991 GID=991
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& BUILD_DEPS=" \
@ -16,6 +17,7 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
ca-certificates" \
&& apk -U add \
${BUILD_DEPS} \
su-exec \
python \
libxml2 \
libxslt \
@ -25,8 +27,6 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& mkdir /usr/local/searx && cd /usr/local/searx \
&& wget -qO- https://github.com/asciimoo/searx/archive/master.tar.gz | tar xz --strip 1 \
&& sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml \
&& adduser -D -h /usr/local/searx -s /bin/sh searx searx \
&& chown -R searx:searx /usr/local/searx \
&& apk del ${BUILD_DEPS} \
&& rm -f /var/cache/apk/*
@ -34,8 +34,6 @@ COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
USER searx
EXPOSE 8888
CMD ["/sbin/tini","--","run.sh"]
CMD ["run.sh"]

View File

@ -4,4 +4,4 @@ sed -i -e "s|base_url : False|base_url : ${BASE_URL}|g" \
-e "s/ultrasecretkey/$(openssl rand -hex 16)/g" \
/usr/local/searx/searx/settings.yml
exec python /usr/local/searx/searx/webapp.py
exec su-exec $UID:$GID /sbin/tini -- python /usr/local/searx/searx/webapp.py

View File

@ -1,15 +1,17 @@
FROM alpine:3.4
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG TOR_VERSION=0.2.8.7
ARG TOR_USER_ID=45553
ARG ARM_VERSION=1.4.5.0
ARG GPG_Mathewson="B35B F85B F194 89D0 4E28 C33C 2119 4EBB 1657 33EA"
ARG GPG_Johnson="6827 8CC5 DD2D 1E85 C4E4 5AD9 0445 B7AB 9ABB EEC6"
ENV TERM=xterm
ENV TERM=xterm \
UID=991 GID=991
RUN BUILD_DEPS=" \
RUN echo "@community https://nl.alpinelinux.org/alpine/v3.4/community" >> /etc/apk/repositories \
&& BUILD_DEPS=" \
libevent-dev \
openssl-dev \
build-base \
@ -17,6 +19,8 @@ RUN BUILD_DEPS=" \
ca-certificates" \
&& apk -U add \
${BUILD_DEPS} \
su-exec \
tini@community \
python \
libevent \
openssl \
@ -33,7 +37,6 @@ RUN BUILD_DEPS=" \
&& echo "All seems good, now unpacking ${TOR_TARBALL}..." \
&& tar xzf ${TOR_TARBALL} && cd tor-${TOR_VERSION} \
&& ./configure --disable-asciidoc && make && make install \
&& adduser -h /var/run/tor -D -s /sbin/nologin -u ${TOR_USER_ID} tor \
&& cd /tmp \
&& ARM_TARBALL="arm-${ARM_VERSION}.tar.bz2" \
&& wget -q https://www.atagar.com/arm/resources/static/${ARM_TARBALL} \
@ -49,8 +52,12 @@ RUN BUILD_DEPS=" \
&& apk del ${BUILD_DEPS} \
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
VOLUME /usr/local/etc/tor /tordata
EXPOSE 9001 9030
USER tor
COPY run.sh /usr/local/bin/run.sh
ENTRYPOINT [ "tor" ]
RUN chmod +x /usr/local/bin/run.sh
VOLUME /tor/config /tor/data
EXPOSE 9001 9030
ENTRYPOINT ["run.sh"]

3
tor/run.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
chown -R $UID:$GID /tor
exec su-exec $UID:$GID tini -- tor $@