mirror of
https://github.com/casjaysdevdocker/caddy
synced 2025-09-20 21:57:46 -04:00
🗃️ Committing everything that changed 🗃️
Some checks failed
release-tag / release-image (push) Failing after 16s
Some checks failed
release-tag / release-image (push) Failing after 16s
rootfs/usr/local/etc/docker/functions/entrypoint.sh rootfs/usr/local/etc/docker/init.d/01-php-fpm.sh rootfs/usr/local/etc/docker/init.d/zz-caddy.sh
This commit is contained in:
16
rootfs/usr/local/etc/docker/init.d/01-php-fpm.sh
Executable file → Normal file
16
rootfs/usr/local/etc/docker/init.d/01-php-fpm.sh
Executable file → Normal file
@@ -28,6 +28,18 @@ SERVICE_USER="daemon"
|
||||
SERVICE_PORT="9000" # port which service is listening on
|
||||
EXEC_CMD_BIN="php-fpm" # command to execute
|
||||
EXEC_CMD_ARGS="--allow-to-run-as-root --nodaemonize --fpm-config /etc/php/php-fpm.conf" # command arguments
|
||||
# Function to exit appropriately based on context
|
||||
__script_exit() {
|
||||
local exit_code="${1:-0}"
|
||||
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
|
||||
# Script is being sourced - use return
|
||||
return "$exit_code"
|
||||
else
|
||||
# Script is being executed - use exit
|
||||
exit "$exit_code"
|
||||
fi
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
PRE_EXEC_MESSAGE="" # Show message before execute
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Other variables that are needed
|
||||
@@ -64,7 +76,7 @@ __update_conf_files() {
|
||||
else
|
||||
echo "php can not be found"
|
||||
[ -f "$www_dir/info.php" ] && echo "PHP support is not enabled" >"$www_dir/info.php"
|
||||
exit 1
|
||||
__script_exit 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -181,4 +193,4 @@ else
|
||||
fi
|
||||
fi
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $SERVICE_EXIT_CODE
|
||||
__script_exit $SERVICE_EXIT_CODE
|
||||
|
14
rootfs/usr/local/etc/docker/init.d/zz-caddy.sh
Executable file → Normal file
14
rootfs/usr/local/etc/docker/init.d/zz-caddy.sh
Executable file → Normal file
@@ -28,6 +28,18 @@ SERVICE_UID="0" # set the user id
|
||||
SERVICE_USER="root" # execute command as another user
|
||||
SERVICE_PORT="" # port which service is listening on
|
||||
EXEC_CMD_BIN="caddy" # command to execute
|
||||
# Function to exit appropriately based on context
|
||||
__script_exit() {
|
||||
local exit_code="${1:-0}"
|
||||
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
|
||||
# Script is being sourced - use return
|
||||
return "$exit_code"
|
||||
else
|
||||
# Script is being executed - use exit
|
||||
exit "$exit_code"
|
||||
fi
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
EXEC_CMD_ARGS="run --config /etc/caddy/Caddyfile" # command arguments
|
||||
PRE_EXEC_MESSAGE="" # Show message before execute
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
@@ -173,4 +185,4 @@ else
|
||||
fi
|
||||
fi
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
exit $SERVICE_EXIT_CODE
|
||||
__script_exit $SERVICE_EXIT_CODE
|
||||
|
Reference in New Issue
Block a user