diff --git a/Containers/apache/Dockerfile b/Containers/apache/Dockerfile index 233f1760..97c7367a 100644 --- a/Containers/apache/Dockerfile +++ b/Containers/apache/Dockerfile @@ -8,7 +8,7 @@ COPY --from=caddy /usr/bin/caddy /usr/bin/caddy COPY --chown=33:33 Caddyfile /Caddyfile COPY --chmod=664 nextcloud.conf /usr/local/apache2/conf/nextcloud.conf -COPY --chmod=664 supervisord.conf /supervisord.conf +COPY dinit.d/ /etc/dinit.d/ COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh @@ -28,7 +28,7 @@ RUN set -ex; \ \ apk add --no-cache \ bash \ - supervisor \ + dinit \ tzdata \ ca-certificates \ bind-tools \ @@ -78,13 +78,6 @@ RUN set -ex; \ mkdir -p /var/www; \ chown -R www-data:www-data /var/www; \ \ - mkdir /var/log/supervisord; \ - mkdir /var/run/supervisord; \ - chown www-data:www-data /var/run/supervisord; \ - chown www-data:www-data /var/log/supervisord; \ - chmod 777 /var/run/supervisord; \ - chmod 777 /var/log/supervisord; \ - \ chown -R www-data:www-data /usr/local/apache2; \ chmod +r -R /usr/local/apache2; \ mkdir -p /usr/local/apache2/logs; \ @@ -94,8 +87,10 @@ RUN set -ex; \ USER www-data:www-data +STOPSIGNAL SIGTERM + ENTRYPOINT ["/start.sh"] -CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] +CMD ["dinit", "--system", "--container", "apache", "caddy"] ENV AIO_LOG_LEVEL=warn diff --git a/Containers/apache/dinit.d/apache b/Containers/apache/dinit.d/apache new file mode 100644 index 00000000..7c717be8 --- /dev/null +++ b/Containers/apache/dinit.d/apache @@ -0,0 +1,5 @@ +type = process +command = httpd -DFOREGROUND +stop-command = httpd -k graceful-stop +restart = yes +options = shares-console diff --git a/Containers/apache/dinit.d/caddy b/Containers/apache/dinit.d/caddy new file mode 100644 index 00000000..45292934 --- /dev/null +++ b/Containers/apache/dinit.d/caddy @@ -0,0 +1,5 @@ +type = process +command = /usr/bin/caddy run --config /tmp/Caddyfile +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/apache/nextcloud.conf b/Containers/apache/nextcloud.conf index b09e86b1..5a490552 100644 --- a/Containers/apache/nextcloud.conf +++ b/Containers/apache/nextcloud.conf @@ -3,7 +3,7 @@ Listen 8000 ServerName localhost # Add error log - CustomLog /proc/self/fd/1 proxy + CustomLog ${AIO_ACCESS_LOG} proxy LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy ErrorLog /proc/self/fd/2 ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]" diff --git a/Containers/apache/start.sh b/Containers/apache/start.sh index 1b48bf8a..5d278df5 100644 --- a/Containers/apache/start.sh +++ b/Containers/apache/start.sh @@ -10,9 +10,9 @@ if [ -z "$NC_DOMAIN" ]; then fi if [ "$AIO_LOG_LEVEL" = 'debug' ]; then - export SUPERVISORD_STDOUT=/dev/stdout + export AIO_ACCESS_LOG=/proc/self/fd/1 else - export SUPERVISORD_STDOUT=NONE + export AIO_ACCESS_LOG=/dev/null fi # Need write access to /mnt/data diff --git a/Containers/apache/supervisord.conf b/Containers/apache/supervisord.conf deleted file mode 100644 index d4eb2622..00000000 --- a/Containers/apache/supervisord.conf +++ /dev/null @@ -1,22 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB -logfile_backups=10 -loglevel=%(ENV_AIO_LOG_LEVEL)s - -[program:apache] -# Stdout logging is disabled as otherwise the logs are spammed -stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=httpd -DFOREGROUND - -[program:caddy] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/usr/bin/caddy run --config /tmp/Caddyfile diff --git a/Containers/clamav/Dockerfile b/Containers/clamav/Dockerfile index 137a114a..a01b5db8 100644 --- a/Containers/clamav/Dockerfile +++ b/Containers/clamav/Dockerfile @@ -3,9 +3,9 @@ FROM alpine:3.24.1 RUN set -ex; \ apk upgrade --no-cache -a; \ - apk add --no-cache tzdata clamav clamav-milter supervisor bash; \ - mkdir -p /tmp /var/lib/clamav /run/clamav /var/log/supervisord /var/run/supervisord; \ - chmod 777 -R /tmp /run/clamav /var/log/clamav /var/log/supervisord /var/run/supervisord; \ + apk add --no-cache tzdata clamav clamav-milter dinit bash; \ + mkdir -p /tmp /var/lib/clamav; \ + chmod 777 -R /tmp /var/log/clamav; \ chown -R clamav:clamav /var/lib/clamav; \ sed -i "s|#\?MaxDirectoryRecursion.*|MaxDirectoryRecursion 30|g" /etc/clamav/clamd.conf; \ sed -i "s|#\?MaxScanSize.*|MaxScanSize 2000M|g" /etc/clamav/clamd.conf; \ @@ -33,14 +33,14 @@ RUN set -ex; \ COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh -COPY --chmod=664 supervisord.conf /supervisord.conf +COPY dinit.d/ /etc/dinit.d/ USER clamav:clamav RUN set -ex; \ freshclam --foreground --stdout VOLUME /var/lib/clamav ENTRYPOINT ["/start.sh"] -CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] +CMD ["dinit", "--system", "--container", "freshclam", "clamd", "milter"] LABEL com.centurylinklabs.watchtower.enable="false" \ wud.watch="false" \ dockhand.update="false" \ diff --git a/Containers/clamav/dinit.d/clamd b/Containers/clamav/dinit.d/clamd new file mode 100644 index 00000000..54dfea53 --- /dev/null +++ b/Containers/clamav/dinit.d/clamd @@ -0,0 +1,5 @@ +type = process +command = clamd --foreground --config-file=/etc/clamav/clamd.conf +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/clamav/dinit.d/freshclam b/Containers/clamav/dinit.d/freshclam new file mode 100644 index 00000000..c2a1b116 --- /dev/null +++ b/Containers/clamav/dinit.d/freshclam @@ -0,0 +1,5 @@ +type = process +command = freshclam --foreground --stdout --daemon --daemon-notify=/etc/clamav/clamd.conf +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/clamav/dinit.d/milter b/Containers/clamav/dinit.d/milter new file mode 100644 index 00000000..a7397e94 --- /dev/null +++ b/Containers/clamav/dinit.d/milter @@ -0,0 +1,5 @@ +type = process +command = clamav-milter --config-file=/etc/clamav/clamav-milter.conf +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/clamav/start.sh b/Containers/clamav/start.sh index 01cb3171..2fb2a5b3 100644 --- a/Containers/clamav/start.sh +++ b/Containers/clamav/start.sh @@ -4,6 +4,8 @@ if [ "$AIO_LOG_LEVEL" = 'debug' ]; then set -x fi +mkdir -p /run/clamav + # Print out clamav version for compliance reasons clamscan --version diff --git a/Containers/clamav/supervisord.conf b/Containers/clamav/supervisord.conf deleted file mode 100644 index 1d7685b1..00000000 --- a/Containers/clamav/supervisord.conf +++ /dev/null @@ -1,29 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB -logfile_backups=10 -loglevel=%(ENV_AIO_LOG_LEVEL)s - -[program:freshclam] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=freshclam --foreground --stdout --daemon --daemon-notify=/etc/clamav/clamd.conf - -[program:clamd] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=clamd --foreground --config-file=/etc/clamav/clamd.conf - -[program:milter] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=clamav-milter --config-file=/etc/clamav/clamav-milter.conf \ No newline at end of file diff --git a/Containers/mastercontainer/Dockerfile b/Containers/mastercontainer/Dockerfile index ba192046..ad2a0b5d 100644 --- a/Containers/mastercontainer/Dockerfile +++ b/Containers/mastercontainer/Dockerfile @@ -27,7 +27,7 @@ COPY community-containers /var/www/docker-aio/community-containers COPY php /var/www/docker-aio/php COPY --chmod=775 Containers/mastercontainer/*.sh / COPY --chmod=664 Containers/mastercontainer/*.Caddyfile / -COPY --chmod=664 Containers/mastercontainer/supervisord.conf /supervisord.conf +COPY Containers/mastercontainer/dinit.d/ /etc/dinit.d/ WORKDIR /var/www/docker-aio @@ -43,7 +43,7 @@ RUN set -ex; \ util-linux-misc \ ca-certificates \ bash \ - supervisor \ + dinit \ su-exec \ netcat-openbsd \ curl \ @@ -95,10 +95,7 @@ RUN set -ex; \ chmod -R 770 /var/www/docker-aio; \ chown -R www-data:www-data /var/www; \ rm -r php/data; \ - rm -r php/session; \ - \ - mkdir /var/log/supervisord; \ - mkdir /var/run/supervisord; + rm -r php/session; # hadolint ignore=DL3048 LABEL org.opencontainers.image.title="Nextcloud All-in-One Mastercontainer" \ diff --git a/Containers/mastercontainer/README.md b/Containers/mastercontainer/README.md index 7206a5f3..7493ad83 100644 --- a/Containers/mastercontainer/README.md +++ b/Containers/mastercontainer/README.md @@ -34,10 +34,10 @@ All-in-One stack. - **Dockerfile**: Instructions for building the mastercontainer image. - **Entrypoint script**: The `start.sh` script is used for container initialization and runtime - configuration before starting supervisord. + configuration before starting dinit. - [**Nextcloud All-in-One Controller App**](https://github.com/nextcloud/all-in-one/tree/main/php): The core AIO orchestrator that handles configuration and settings for the containers. -- **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within +- **dinit**: The service description files in `dinit.d/` define the long-running services hosted within the container (php-fpm, cron, etc.) ## Usage diff --git a/Containers/mastercontainer/dinit.d/backup-time-file-watcher b/Containers/mastercontainer/dinit.d/backup-time-file-watcher new file mode 100644 index 00000000..88ebbdb1 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/backup-time-file-watcher @@ -0,0 +1,5 @@ +type = process +command = /backup-time-file-watcher.sh +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/caddy-acme b/Containers/mastercontainer/dinit.d/caddy-acme new file mode 100644 index 00000000..d85265a4 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/caddy-acme @@ -0,0 +1,6 @@ +type = process +command = /usr/bin/caddy run --config /acme.Caddyfile +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/caddy-internal b/Containers/mastercontainer/dinit.d/caddy-internal new file mode 100644 index 00000000..23ca61b2 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/caddy-internal @@ -0,0 +1,6 @@ +type = process +command = /usr/bin/caddy run --config /internal.Caddyfile +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/cron b/Containers/mastercontainer/dinit.d/cron new file mode 100644 index 00000000..0fbb60b4 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/cron @@ -0,0 +1,5 @@ +type = process +command = /cron.sh +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/domain-validator b/Containers/mastercontainer/dinit.d/domain-validator new file mode 100644 index 00000000..62693914 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/domain-validator @@ -0,0 +1,6 @@ +type = process +command = php -S 127.0.0.1:9876 /var/www/docker-aio/php/domain-validator.php +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/php-fpm b/Containers/mastercontainer/dinit.d/php-fpm new file mode 100644 index 00000000..d3d91908 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/php-fpm @@ -0,0 +1,5 @@ +type = process +command = php-fpm +term-signal = QUIT +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/dinit.d/session-deduplicator b/Containers/mastercontainer/dinit.d/session-deduplicator new file mode 100644 index 00000000..8e536834 --- /dev/null +++ b/Containers/mastercontainer/dinit.d/session-deduplicator @@ -0,0 +1,6 @@ +type = process +command = /session-deduplicator.sh +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index c7f130e4..b58ecde2 100755 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -347,10 +347,9 @@ if [ -z "$AIO_LOG_LEVEL" ]; then export AIO_LOG_LEVEL="warn" fi -if [ "$AIO_LOG_LEVEL" = 'debug' ]; then - export SUPERVISORD_STDOUT=/dev/stdout -else - export SUPERVISORD_STDOUT=NONE +if [ "$AIO_LOG_LEVEL" != 'debug' ]; then + sed -i 's|access.log = /proc/self/fd/1|access.log = /dev/null|' /usr/local/etc/php-fpm.d/docker.conf + sed -i 's|^options = shares-console|#options = shares-console|' /etc/dinit.d/domain-validator fi # Check if ghcr.io is reachable @@ -449,5 +448,5 @@ rm -rf /tmp/twig-cache/* chown www-data:www-data /tmp/twig-cache chmod 770 /tmp/twig-cache -# Start supervisord -exec /usr/bin/supervisord -c /supervisord.conf +# Start dinit +exec dinit --system --container php-fpm caddy-internal caddy-acme cron backup-time-file-watcher session-deduplicator domain-validator diff --git a/Containers/mastercontainer/supervisord.conf b/Containers/mastercontainer/supervisord.conf deleted file mode 100644 index aa310a16..00000000 --- a/Containers/mastercontainer/supervisord.conf +++ /dev/null @@ -1,64 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB -logfile_backups=10 -loglevel=%(ENV_AIO_LOG_LEVEL)s -user=root - -[program:php-fpm] -# Stdout logging is disabled as otherwise the logs are spammed -stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=php-fpm -user=root - -[program:caddy-internal] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/usr/bin/caddy run --config /internal.Caddyfile -user=www-data - -[program:caddy-acme] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/usr/bin/caddy run --config /acme.Caddyfile -user=www-data - -[program:cron] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/cron.sh -user=root - -[program:backup-time-file-watcher] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/backup-time-file-watcher.sh -user=root - -[program:session-deduplicator] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/session-deduplicator.sh -user=www-data - -[program:domain-validator] -# Logging is disabled as otherwise all attempts will be logged which spams the logs -stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s -stderr_logfile=%(ENV_SUPERVISORD_STDOUT)s -command=php -S 127.0.0.1:9876 /var/www/docker-aio/php/domain-validator.php -user=www-data diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 87c63532..6d1f30db 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -20,7 +20,7 @@ ENV AIO_URL=localhost COPY --chmod=775 Containers/nextcloud/*.sh / COPY --chmod=774 Containers/nextcloud/upgrade.exclude /upgrade.exclude COPY Containers/nextcloud/config/*.php / -COPY Containers/nextcloud/supervisord.conf /supervisord.conf +COPY Containers/nextcloud/dinit.d/ /etc/dinit.d/ # AIO cloning start # Do not remove or change this line! COPY app /usr/src/nextcloud/apps/nextcloud-aio @@ -191,7 +191,7 @@ RUN set -ex; \ ffmpeg \ procps \ samba-client \ - supervisor \ + dinit \ # libreoffice \ ; \ \ @@ -224,13 +224,6 @@ RUN set -ex; \ apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \ apk del .build-deps; \ \ - mkdir -p \ - /var/log/supervisord \ - /var/run/supervisord \ - ; \ - chmod 777 -R /var/log/supervisord; \ - chmod 777 -R /var/run/supervisord; \ - \ apk add --no-cache \ bash \ netcat-openbsd \ @@ -286,7 +279,7 @@ RUN set -ex; \ # hadolint ignore=DL3002 USER root:root ENTRYPOINT ["/start.sh"] -CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] +CMD ["dinit", "--system", "--container", "php-fpm", "cron", "taskprocessing-worker", "run-exec-commands", "is-nextcloud-online"] HEALTHCHECK CMD ["/healthcheck.sh"] LABEL com.centurylinklabs.watchtower.enable="false" \ diff --git a/Containers/nextcloud/README.md b/Containers/nextcloud/README.md index 574afd03..ca3983b8 100644 --- a/Containers/nextcloud/README.md +++ b/Containers/nextcloud/README.md @@ -13,9 +13,9 @@ The Nextcloud container provides the core Nextcloud application environment, inc ## Contents - **Dockerfile**: Instructions for building the Nextcloud container image. -- **Entrypoint script**: The `start.sh` script is used for container initialization and runtime configuration before starting supervisord. +- **Entrypoint script**: The `start.sh` script is used for container initialization and runtime configuration before starting dinit. - **Nextcloud configuration files**: Specific to running in a containerized setting and/or within AIO. -- **Supervisor**: The `supervisord.conf` file defines the long-running services hosted within the container (php-fpm, cron, etc.). +- **dinit**: The service description files in `dinit.d/` define the long-running services hosted within the container (php-fpm, cron, etc.). ## Usage diff --git a/Containers/nextcloud/dinit.d/cron b/Containers/nextcloud/dinit.d/cron new file mode 100644 index 00000000..42ef7dca --- /dev/null +++ b/Containers/nextcloud/dinit.d/cron @@ -0,0 +1,6 @@ +type = process +command = /cron.sh +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/nextcloud/dinit.d/is-nextcloud-online b/Containers/nextcloud/dinit.d/is-nextcloud-online new file mode 100644 index 00000000..34c32f4d --- /dev/null +++ b/Containers/nextcloud/dinit.d/is-nextcloud-online @@ -0,0 +1,6 @@ +type = process +command = timeout 86400 nc -lk 9001 +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/nextcloud/dinit.d/php-fpm b/Containers/nextcloud/dinit.d/php-fpm new file mode 100644 index 00000000..d3d91908 --- /dev/null +++ b/Containers/nextcloud/dinit.d/php-fpm @@ -0,0 +1,5 @@ +type = process +command = php-fpm +term-signal = QUIT +restart = yes +options = shares-console diff --git a/Containers/nextcloud/dinit.d/run-exec-commands b/Containers/nextcloud/dinit.d/run-exec-commands new file mode 100644 index 00000000..e4289075 --- /dev/null +++ b/Containers/nextcloud/dinit.d/run-exec-commands @@ -0,0 +1,6 @@ +type = process +command = /run-exec-commands.sh +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/nextcloud/dinit.d/taskprocessing-worker b/Containers/nextcloud/dinit.d/taskprocessing-worker new file mode 100644 index 00000000..50b96be2 --- /dev/null +++ b/Containers/nextcloud/dinit.d/taskprocessing-worker @@ -0,0 +1,6 @@ +type = process +command = php /var/www/html/occ taskprocessing:worker --timeout 300 +run-as = www-data +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/nextcloud/supervisord.conf b/Containers/nextcloud/supervisord.conf deleted file mode 100644 index eec24f6f..00000000 --- a/Containers/nextcloud/supervisord.conf +++ /dev/null @@ -1,54 +0,0 @@ -# From https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm/supervisord.conf -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB ; maximum size of logfile before rotation -logfile_backups=10 ; number of backed up logfiles -loglevel=%(ENV_AIO_LOG_LEVEL)s -user=root - -[program:php-fpm] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=php-fpm -user=root - -[program:cron] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/cron.sh -user=www-data - -[program:taskprocessing-worker] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=php /var/www/html/occ taskprocessing:worker --timeout 300 -autorestart=true -user=www-data - -[program:run-exec-commands] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=/run-exec-commands.sh -user=www-data - -# This is a hack but no better solution is there -[program:is-nextcloud-online] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -# Restart the netcat command once a day to ensure that it stays reachable -# See https://github.com/nextcloud/all-in-one/issues/6334 -command=timeout 86400 nc -lk 9001 -user=www-data diff --git a/Containers/talk/Dockerfile b/Containers/talk/Dockerfile index c3176d28..e7d6c8fe 100644 --- a/Containers/talk/Dockerfile +++ b/Containers/talk/Dockerfile @@ -26,7 +26,7 @@ COPY --from=signaling --chmod=777 --chown=1000:1000 /usr/bin/nextcloud-spreed-si COPY --chmod=775 start.sh /start.sh COPY --chmod=775 healthcheck.sh /healthcheck.sh -COPY --chmod=664 supervisord.conf /supervisord.conf +COPY dinit.d/ /etc/dinit.d/ SHELL ["/bin/ash", "-o", "pipefail", "-c"] RUN set -ex; \ @@ -36,7 +36,7 @@ RUN set -ex; \ tzdata \ bash \ openssl \ - supervisor \ + dinit \ bind-tools \ netcat-openbsd \ \ @@ -66,24 +66,18 @@ RUN set -ex; \ /var/tmp \ /conf \ /var/lib/turn \ - /var/log/supervisord \ - /var/run/supervisord \ /usr/lib/janus/loggers; \ chown eturnal:eturnal -R \ - /etc/nats.conf \ - /var/log/supervisord \ - /var/run/supervisord; \ + /etc/nats.conf; \ chmod 777 -R \ /tmp \ - /conf \ - /var/run/supervisord \ - /var/log/supervisord; \ + /conf; \ ln -s /opt/eturnal/bin/stun /usr/local/bin/stun; \ ln -s /opt/eturnal/bin/eturnalctl /usr/local/bin/eturnalctl USER eturnal:eturnal ENTRYPOINT ["/start.sh"] -CMD ["supervisord", "-c", "/supervisord.conf"] +CMD ["dinit", "--system", "--container", "nats-server", "eturnal", "janus", "signaling"] HEALTHCHECK CMD ["/healthcheck.sh"] LABEL com.centurylinklabs.watchtower.enable="false" \ diff --git a/Containers/talk/dinit.d/eturnal b/Containers/talk/dinit.d/eturnal new file mode 100644 index 00000000..2d75b61a --- /dev/null +++ b/Containers/talk/dinit.d/eturnal @@ -0,0 +1,5 @@ +type = process +command = eturnalctl foreground +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/talk/dinit.d/janus b/Containers/talk/dinit.d/janus new file mode 100644 index 00000000..9d4df14f --- /dev/null +++ b/Containers/talk/dinit.d/janus @@ -0,0 +1,5 @@ +type = process +command = janus --config=/conf/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level $JANUS_LOG_LEVEL +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/talk/dinit.d/nats-server b/Containers/talk/dinit.d/nats-server new file mode 100644 index 00000000..ed5a516c --- /dev/null +++ b/Containers/talk/dinit.d/nats-server @@ -0,0 +1,5 @@ +type = process +command = nats-server -c /etc/nats.conf +term-signal = TERM +restart = yes +options = shares-console diff --git a/Containers/talk/dinit.d/signaling b/Containers/talk/dinit.d/signaling new file mode 100644 index 00000000..4e6a2396 --- /dev/null +++ b/Containers/talk/dinit.d/signaling @@ -0,0 +1,7 @@ +type = process +command = nextcloud-spreed-signaling -config /conf/signaling.conf +term-signal = TERM +restart = yes +options = shares-console +depends-on = nats-server +depends-on = janus diff --git a/Containers/talk/supervisord.conf b/Containers/talk/supervisord.conf deleted file mode 100644 index 69889a4c..00000000 --- a/Containers/talk/supervisord.conf +++ /dev/null @@ -1,44 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/var/log/supervisord/supervisord.log -pidfile=/var/run/supervisord/supervisord.pid -childlogdir=/var/log/supervisord/ -logfile_maxbytes=50MB -logfile_backups=10 -loglevel=%(ENV_AIO_LOG_LEVEL)s - -[program:nats-server] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=nats-server -c /etc/nats.conf -# Start first: signaling depends on NATS being available -priority=10 - -[program:eturnal] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=eturnalctl foreground -# Start alongside Janus; independent of signaling -priority=20 - -[program:janus] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=janus --config=/conf/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level %(ENV_JANUS_LOG_LEVEL)s -# Start alongside eturnal; signaling connects to Janus via WebSocket -priority=20 - -[program:signaling] -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 -command=nextcloud-spreed-signaling -config /conf/signaling.conf -# Start last: depends on NATS (priority=10) and Janus (priority=20) being up -priority=30 diff --git a/php/containers.json b/php/containers.json index 09fcd34e..fcd63395 100644 --- a/php/containers.json +++ b/php/containers.json @@ -75,8 +75,7 @@ ], "read_only": true, "tmpfs": [ - "/var/log/supervisord", - "/var/run/supervisord", + "/run", "/usr/local/apache2/logs", "/tmp", "/home/www-data" @@ -482,8 +481,7 @@ ], "read_only": true, "tmpfs": [ - "/var/log/supervisord", - "/var/run/supervisord", + "/run", "/opt/eturnal/run", "/conf", "/tmp" @@ -679,7 +677,7 @@ "display_name": "ClamAV", "image": "ghcr.io/nextcloud-releases/aio-clamav", "user": "100", - "init": false, + "init": true, "healthcheck": { "start_period": "60s", "test": "/healthcheck.sh", @@ -710,11 +708,9 @@ ], "read_only": true, "tmpfs": [ + "/run", "/tmp", - "/var/log/clamav", - "/run/clamav", - "/var/log/supervisord", - "/var/run/supervisord" + "/var/log/clamav" ], "cap_drop": [ "NET_RAW"