1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 09:04:12 +02:00

use supervisord in image

This commit is contained in:
Robin Appelman 2026-03-12 00:21:54 +01:00
commit 6fdadd9bad
9 changed files with 47 additions and 17 deletions

View file

@ -28,8 +28,6 @@ echo "{}" > /var/www/html/build/integration/composer.lock
echo "Starting server using $SQL database…"
# tail --follow --retry /var/log/nginx/*.log /var/log/cron/owncloud.log &
chmod +sx /sbin/sudo
mkdir -p /var/log/nginx /tmp /var/run/blackfire
@ -57,23 +55,15 @@ fi
if [ -n "${REDIS_TLS:-}" ]
then
redis-server --protected-mode no \
--tls-port 6379 --port 0 \
--tls-cert-file /certificates/redis/server.crt \
--tls-key-file /certificates/redis/server.key \
--tls-ca-cert-file /certificates/redis/ca.crt &
cp /etc/supervisor/redis-tls.conf /etc/supervisor/enabled/
else
redis-server --protected-mode no &
cp /etc/supervisor/redis-plain.conf /etc/supervisor/enabled/
fi
if [ -n "${BLACKFIRE_SERVER_ID:-}" ]
then
sh -c '
yes | blackfire agent:config --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN
BLACKFIRE_LOG_LEVEL=4 BLACKFIRE_LOG_FILE=/var/log/agent.log blackfire agent &
'&
blackfire agent:config --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN"
cp /etc/supervisor/blackfire.conf /etc/supervisor/enabled/
fi
php-fpm --fpm-config /etc/php-fpm.conf&
nginx -c /etc/nginx.conf
exec supervisord -c /etc/supervisor/supervisord.conf

View file

@ -7,6 +7,9 @@ runCommand "configs" {} ''
cp ${./configs/nginx-app.conf} $out/conf/nginx-app.conf
cp ${./configs/sudoers} $out/etc/sudoers.d/haze
cp -r ${./configs/nc} $out/etc/nc
cp ${./php-fpm.conf} $out/etc/php-fpm.conf
cp ${./nginx.conf} $out/etc/nginx.conf
cp ${./configs/php-fpm.conf} $out/etc/php-fpm.conf
cp ${./configs/nginx.conf} $out/etc/nginx.conf
cp -r ${./configs/supervisor} $out/etc/supervisor
chmod +w $out/etc/supervisor
mkdir $out/etc/supervisor/enabled/
''

View file

@ -0,0 +1,2 @@
[program:blackfire]
command = blackfire agent

View file

@ -0,0 +1,2 @@
[program:redis]
command = /bin/redis-server --protected-mode no

View file

@ -0,0 +1,6 @@
[program:redis-tls]
command = /bin/redis-server --protected-mode no \
--tls-port 6379 --port 0 \
--tls-cert-file /certificates/redis/server.crt \
--tls-key-file /certificates/redis/server.key \
--tls-ca-cert-file /certificates/redis/ca.crt

View file

@ -0,0 +1,25 @@
[supervisord]
logfile = /dev/stdout
logfile_maxbytes = 0
nodaemon = true
pidfile = /var/run/supervisord.pid
[unix_http_server]
file = /var/run/supervisor.sock
chmod = 0777
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///var/run/supervisor.sock
[program:nginx]
command = /bin/nginx -c /etc/nginx.conf
[program:php-fpm]
command = /bin/php-fpm --fpm-config /etc/php-fpm.conf
[include]
files = enabled/*

View file

@ -33,6 +33,7 @@
writeShellApplication,
vim,
helix,
python3Packages,
}: let
inherit (builtins) toString;
inherit (lib) readFile getExe concatStringsSep splitString take;
@ -145,6 +146,7 @@
oracle-instantclient
vim
helix
python3Packages.supervisor
];
};