diff --git a/rootfs/docker-entrypoint-init.d/01-uname.sh b/rootfs/docker-entrypoint-init.d/01-uname.sh deleted file mode 100755 index a3731a4..0000000 --- a/rootfs/docker-entrypoint-init.d/01-uname.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# Test file to check init scripts -uname -a \ No newline at end of file diff --git a/rootfs/docker-entrypoint-init.d/99-startup-commands.sh b/rootfs/docker-entrypoint-init.d/99-startup-commands.sh new file mode 100644 index 0000000..241596b --- /dev/null +++ b/rootfs/docker-entrypoint-init.d/99-startup-commands.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Zähler für die Befehle +i=0 + +# Schleife, um die Befehle aus den Umgebungsvariablen zu lesen +while :; do + # Dynamische Umgebungsvariable aufbauen + cmd_var="STARTUP_COMMAND_$i" + + # Überprüfen, ob die Umgebungsvariable gesetzt ist + if [ -n "${!cmd_var}" ]; then + echo "Führe Befehl $i aus: ${!cmd_var}" + eval "${!cmd_var}" + i=$((i + 1)) # Zähler erhöhen + else + break # Schleife beenden, wenn keine weitere Variable gesetzt ist + fi +done \ No newline at end of file diff --git a/rootfs/etc/nginx/nginx.conf b/rootfs/etc/nginx/nginx.conf index 9b50e77..7551ffe 100644 --- a/rootfs/etc/nginx/nginx.conf +++ b/rootfs/etc/nginx/nginx.conf @@ -72,6 +72,7 @@ http { location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php-fpm.sock; + fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; @@ -82,6 +83,8 @@ http { # Pass the original forwarded_scheme and HTTPS status to the PHP backend fastcgi_param HTTP_X_FORWARDED_PROTO $forwarded_scheme; fastcgi_param HTTPS $https if_not_empty; + + internal; }