This commit is contained in:
Alexandre
2024-04-26 18:53:54 +02:00
parent 4db7d13154
commit ce3cd7064f
4 changed files with 16 additions and 6 deletions

View File

@@ -1,12 +1,13 @@
#!/usr/bin/with-contenv bashio
# Dependencies
until [[ -e /var/run/dbus/system_bus_socket ]] && [[ -e /run/php/php*-fpm.sock ]]; do
sockfile="$(find /run/php -name *.sock)"
until [[ -e /var/run/dbus/system_bus_socket ]] && [[ -e "$sockfile" ]]; do
sleep 1s
done
# Correct fpm.sock
sed -i "s|/run/php/php-fpm.sock|$(find /run/php -name *.sock)|g" /etc/caddy/Caddyfile
chown caddy:caddy /run/php/php*-fpm.sock
sed -i "s|/run/php/php-fpm.sock|$sockfile|g" /etc/caddy/Caddyfile
echo "Starting service: caddy"
exec \
s6-setuidgid "$USER" /usr/bin/caddy run --config /etc/caddy/Caddyfile
/usr/bin/caddy run --config /etc/caddy/Caddyfile