1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +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…" echo "Starting server using $SQL database…"
# tail --follow --retry /var/log/nginx/*.log /var/log/cron/owncloud.log &
chmod +sx /sbin/sudo chmod +sx /sbin/sudo
mkdir -p /var/log/nginx /tmp /var/run/blackfire mkdir -p /var/log/nginx /tmp /var/run/blackfire
@ -57,23 +55,15 @@ fi
if [ -n "${REDIS_TLS:-}" ] if [ -n "${REDIS_TLS:-}" ]
then then
redis-server --protected-mode no \ cp /etc/supervisor/redis-tls.conf /etc/supervisor/enabled/
--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 &
else else
redis-server --protected-mode no & cp /etc/supervisor/redis-plain.conf /etc/supervisor/enabled/
fi fi
if [ -n "${BLACKFIRE_SERVER_ID:-}" ] if [ -n "${BLACKFIRE_SERVER_ID:-}" ]
then then
sh -c ' blackfire agent:config --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN"
yes | blackfire agent:config --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN cp /etc/supervisor/blackfire.conf /etc/supervisor/enabled/
BLACKFIRE_LOG_LEVEL=4 BLACKFIRE_LOG_FILE=/var/log/agent.log blackfire agent &
'&
fi fi
php-fpm --fpm-config /etc/php-fpm.conf& exec supervisord -c /etc/supervisor/supervisord.conf
nginx -c /etc/nginx.conf

View file

@ -7,6 +7,9 @@ runCommand "configs" {} ''
cp ${./configs/nginx-app.conf} $out/conf/nginx-app.conf cp ${./configs/nginx-app.conf} $out/conf/nginx-app.conf
cp ${./configs/sudoers} $out/etc/sudoers.d/haze cp ${./configs/sudoers} $out/etc/sudoers.d/haze
cp -r ${./configs/nc} $out/etc/nc cp -r ${./configs/nc} $out/etc/nc
cp ${./php-fpm.conf} $out/etc/php-fpm.conf cp ${./configs/php-fpm.conf} $out/etc/php-fpm.conf
cp ${./nginx.conf} $out/etc/nginx.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, writeShellApplication,
vim, vim,
helix, helix,
python3Packages,
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;
inherit (lib) readFile getExe concatStringsSep splitString take; inherit (lib) readFile getExe concatStringsSep splitString take;
@ -145,6 +146,7 @@
oracle-instantclient oracle-instantclient
vim vim
helix helix
python3Packages.supervisor
]; ];
}; };