From b40fe970b77f477b721aff28efafe3044ab548a6 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Tue, 23 Jul 2024 23:27:25 +0200 Subject: [PATCH] fix caddy for public sites caddy is now fully functional only nitpick is that 444 is always required and docker build for the porkbun support --- caddy/Caddyfile | 22 +++++++++++----------- caddy/Dockerfile | 9 +++++++++ caddy/compose.yaml | 9 ++++----- 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 caddy/Dockerfile diff --git a/caddy/Caddyfile b/caddy/Caddyfile index b272d82..6c18c1f 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,14 +1,14 @@ # GLOBAL CONFIGURATIONS { - #http_port 81 - #https_port 444 + http_port 81 + https_port 444 # readd later already rate limited :( email mika.bomm@outlook.com - acme_ca https://acme-staging-v02.api.letsencrypt.org/directory - #acme_dns porkbun { - # api_key {$PORKBUN_API_KEY} # dont hardcode this please - # api_secret_key {$PORKBUN_API_SECRET_KEY} #dont hardcode this please - #} + #acme_ca https://acme-staging-v02.api.letsencrypt.org/directory + acme_dns porkbun { + api_key {$PORKBUN_API_KEY} # dont hardcode this please + api_secret_key {$PORKBUN_API_SECRET_KEY} #dont hardcode this please + } # auto_https off # Done for debugging @@ -22,11 +22,11 @@ } } -#pdf2.mixel.cloud { -# reverse_proxy 192.168.178.230:55556 -#} +pdf2.mixel.cloud { + reverse_proxy 192.168.178.230:55556 +} -mini1.docker.local { +https://mini1.docker.local { import logging reverse_proxy http://192.168.178.230:55556 } diff --git a/caddy/Dockerfile b/caddy/Dockerfile new file mode 100644 index 0000000..7397616 --- /dev/null +++ b/caddy/Dockerfile @@ -0,0 +1,9 @@ +# Dockerfile +FROM caddy:builder AS builder + +RUN xcaddy build \ + --with github.com/caddy-dns/porkbun + +FROM caddy:2.8.4-alpine + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy diff --git a/caddy/compose.yaml b/caddy/compose.yaml index 2d9e0bf..27fe10d 100644 --- a/caddy/compose.yaml +++ b/caddy/compose.yaml @@ -1,12 +1,13 @@ services: caddy: - image: caddy:2.8.4-alpine + build: + context: . + dockerfile: Dockerfile restart: unless-stopped container_name: caddy ports: - - "80:80" - - "443:443" - "81:81" + - "444:444" volumes: - ./Caddyfile:/etc/caddy/Caddyfile - ./site:/srv @@ -21,9 +22,7 @@ services: networks: caddy: - volumes: caddy_data: external: true caddy_config: -