images/caddy/entrypoint.sh
2024-06-06 17:27:05 -04:00

23 lines
482 B
Bash

#!/bin/sh
URL="https://caddyserver.com/api/download?os=linux&arch=amd64"
IFS=" "
for module in $MODULES
do
module=$(echo "$module" | sed 's/\//%2F/g')
URL="$URL&p=github.com/$module"
done
wget "$URL" -O /usr/sbin/caddy
chmod +x /usr/sbin/caddy
if [ ! -f "/etc/caddy/Caddyfile" ]; then
cp /etc/default/Caddyfile /etc/caddy/Caddyfile
fi
export XDG_CONFIG_HOME=/config
export XDG_DATA_HOME=/data
exec /usr/sbin/caddy run \
--config /etc/caddy/Caddyfile \
--adapter caddyfile