commit 91cdb9ba56550944b125baffd3ab63d979892b30 Author: Jan Funke Date: Wed Dec 3 20:54:03 2025 +0100 added first config diff --git a/Caddyfile.tmpl b/Caddyfile.tmpl new file mode 100644 index 0000000..b687550 --- /dev/null +++ b/Caddyfile.tmpl @@ -0,0 +1,9 @@ +{ + acme_dns desec { + token {env.GANDI_BEARER_TOKEN} + } + + test.com { + reverse_proxy localhost:8080 + } +} \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..b9674ab --- /dev/null +++ b/Containerfile @@ -0,0 +1,9 @@ +ARG CADDY_VERSION=2 +FROM caddy:${CADDY_VERSION}-builder AS builder + +RUN xcaddy build \ + --with github.com/caddy-dns/desec + +FROM caddy:${CADDY_VERSION} + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy \ No newline at end of file diff --git a/caddy-config.volume b/caddy-config.volume new file mode 100644 index 0000000..e69de29 diff --git a/caddy-data.volume b/caddy-data.volume new file mode 100644 index 0000000..e69de29 diff --git a/caddy.build b/caddy.build new file mode 100644 index 0000000..d58a828 --- /dev/null +++ b/caddy.build @@ -0,0 +1,7 @@ +[Unit] +Description=Build caddy image with desec.io DNS plugin + +[Build] +File=%h/container/caddy/Containerfile +ImageTag=caddy-gandi:latest +SetWorkingDirectory=unit \ No newline at end of file diff --git a/caddy.container b/caddy.container new file mode 100644 index 0000000..20dcfe8 --- /dev/null +++ b/caddy.container @@ -0,0 +1,23 @@ +[Unit] +Description=Caddy reverse proxy (Desec.io DNS challenge) + +[Container] +Image=caddy.build +ContainerName=caddy +PublishPort=8080:80 +PublishPort=8443:443 +Volume=./Caddyfile:/etc/caddy/Caddyfile:ro,Z +Volume=caddy-data:/data +Volume=caddy-config:/config + +Secret=desec-token,type=env,target=GANDI_BEARER_TOKEN + +# For ACME notifications +EnvironmentFile=./config.env + +[Service] +Restart=always +RestartSec=3 + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/config.env.tmpl b/config.env.tmpl new file mode 100644 index 0000000..7aba0ee --- /dev/null +++ b/config.env.tmpl @@ -0,0 +1 @@ +ACME_EMAIL=admin@test.com