Merge branch 's6-rc'
This commit is contained in:
commit
7bc25d916b
9 changed files with 23 additions and 9 deletions
15
Dockerfile
15
Dockerfile
|
@ -5,7 +5,7 @@ ARG COMPOSER_PACKAGES=google/cloud-storage
|
||||||
ARG PBURL=https://github.com/PrivateBin/PrivateBin/
|
ARG PBURL=https://github.com/PrivateBin/PrivateBin/
|
||||||
ARG RELEASE=1.3.5
|
ARG RELEASE=1.3.5
|
||||||
|
|
||||||
ENV CONFIG_PATH=/srv/cfg S6_READ_ONLY_ROOT=1
|
ENV CONFIG_PATH=/srv/cfg
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors=support@privatebin.org \
|
LABEL org.opencontainers.image.authors=support@privatebin.org \
|
||||||
org.opencontainers.image.vendor=PrivateBin \
|
org.opencontainers.image.vendor=PrivateBin \
|
||||||
|
@ -25,7 +25,7 @@ RUN \
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
&& apk upgrade --no-cache \
|
&& apk upgrade --no-cache \
|
||||||
&& apk add --no-cache gnupg git nginx php8-fpm php8-json php8-gd php8-opcache \
|
&& apk add --no-cache gnupg git nginx php8-fpm php8-json php8-gd php8-opcache \
|
||||||
s6-overlay tzdata ${ALPINE_PACKAGES} ${ALPINE_COMPOSER_PACKAGES} \
|
s6-linux-init s6-rc tzdata ${ALPINE_PACKAGES} ${ALPINE_COMPOSER_PACKAGES} \
|
||||||
# Remove (some of the) default nginx config
|
# Remove (some of the) default nginx config
|
||||||
&& rm -f /etc/nginx.conf /etc/nginx/http.d/default.conf /etc/php8/php-fpm.d/www.conf \
|
&& rm -f /etc/nginx.conf /etc/nginx/http.d/default.conf /etc/php8/php-fpm.d/www.conf \
|
||||||
&& rm -rf /etc/nginx/sites-* \
|
&& rm -rf /etc/nginx/sites-* \
|
||||||
|
@ -67,18 +67,21 @@ RUN \
|
||||||
&& mkdir -p /srv/data \
|
&& mkdir -p /srv/data \
|
||||||
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
|
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
|
||||||
# Support running s6 under a non-root user
|
# Support running s6 under a non-root user
|
||||||
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm8/supervise \
|
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm8/supervise /etc/s6-rc \
|
||||||
&& mkfifo \
|
&& mkfifo \
|
||||||
/etc/s6/services/nginx/supervise/control \
|
/etc/s6/services/nginx/supervise/control \
|
||||||
/etc/s6/services/php-fpm8/supervise/control \
|
/etc/s6/services/php-fpm8/supervise/control \
|
||||||
&& chown -R 65534:82 /etc/s6 /run /srv/* /var/lib/nginx /var/www \
|
&& chown -R 65534:82 /etc/s6 /run /srv/* /var/lib/nginx /var/www \
|
||||||
&& chmod o+rwx /run /var/lib/nginx /var/lib/nginx/tmp \
|
&& chmod o+rwx /run /var/lib/nginx /var/lib/nginx/tmp /usr/bin/s6-linux-init* \
|
||||||
# Clean up
|
# Clean up
|
||||||
&& rm -rf "${GNUPGHOME}" /tmp/* \
|
&& rm -rf "${GNUPGHOME}" /tmp/* \
|
||||||
&& apk del gnupg git ${ALPINE_COMPOSER_PACKAGES}
|
&& apk del --no-cache gnupg git ${ALPINE_COMPOSER_PACKAGES}
|
||||||
|
|
||||||
COPY etc/ /etc/
|
COPY etc/ /etc/
|
||||||
|
|
||||||
|
RUN s6-rc-compile /etc/s6-rc/compiled /etc/s6/services \
|
||||||
|
&& s6-linux-init-maker -C -N -B /etc/s6-linux-init/current
|
||||||
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
# user nobody, group www-data
|
# user nobody, group www-data
|
||||||
USER 65534:82
|
USER 65534:82
|
||||||
|
@ -88,4 +91,4 @@ VOLUME /run /srv/data /tmp /var/lib/nginx/tmp
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["/init"]
|
ENTRYPOINT ["/etc/s6-linux-init/current/bin/init"]
|
||||||
|
|
6
etc/s6-linux-init/skel/rc.init
Executable file
6
etc/s6-linux-init/skel/rc.init
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
rl="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
s6-rc-init /run/service
|
||||||
|
s6-rc -v2 -u change default
|
2
etc/s6/services/default/contents
Normal file
2
etc/s6/services/default/contents
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
nginx
|
||||||
|
php-fpm8
|
1
etc/s6/services/default/type
Normal file
1
etc/s6/services/default/type
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bundle
|
1
etc/s6/services/nginx/dependencies
Normal file
1
etc/s6/services/nginx/dependencies
Normal file
|
@ -0,0 +1 @@
|
||||||
|
php-fpm8
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/execlineb -P
|
#!/bin/execlineb -P
|
||||||
forx -o 127 timer { 0 1 2 3 4 5 6 7 8 9 }
|
forx -o 127 timer { 0 1 2 3 4 5 6 7 8 9 }
|
||||||
ifelse {
|
ifelse {
|
||||||
test -S /var/run/php-fpm.sock
|
test -S /var/run/php-fpm.sock
|
||||||
|
|
1
etc/s6/services/nginx/type
Normal file
1
etc/s6/services/nginx/type
Normal file
|
@ -0,0 +1 @@
|
||||||
|
longrun
|
|
@ -1,3 +1,2 @@
|
||||||
#!/usr/bin/execlineb -P
|
#!/bin/execlineb -P
|
||||||
with-contenv
|
|
||||||
/usr/sbin/php-fpm8
|
/usr/sbin/php-fpm8
|
||||||
|
|
1
etc/s6/services/php-fpm8/type
Normal file
1
etc/s6/services/php-fpm8/type
Normal file
|
@ -0,0 +1 @@
|
||||||
|
longrun
|
Loading…
Add table
Add a link
Reference in a new issue