From d20185463b6e54166ea5e10da4f7d1a9ac527566 Mon Sep 17 00:00:00 2001 From: morthimer Date: Wed, 5 Jun 2024 18:42:20 +0000 Subject: [PATCH] new: add Caddy homelab container --- _caddy/.env.example | 7 +++++++ _caddy/compose.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 _caddy/.env.example create mode 100644 _caddy/compose.yaml diff --git a/_caddy/.env.example b/_caddy/.env.example new file mode 100644 index 0000000..5542a3a --- /dev/null +++ b/_caddy/.env.example @@ -0,0 +1,7 @@ +SOCKET=/var/run/docker.sock +ENDPOINT=your_endpoint +APP_KEY=your_application_key +APP_SECRET=your_application_secret +CONSUMER_KEY=your_consumer_key +DOMAIN=example.com +INT_DOMAIN=hl.$DOMAIN #homelab diff --git a/_caddy/compose.yaml b/_caddy/compose.yaml new file mode 100644 index 0000000..d2be4c8 --- /dev/null +++ b/_caddy/compose.yaml @@ -0,0 +1,32 @@ +--- +services: + caddy: + container_name: caddy + image: git.morthimer.fr/morthimer/caddy-homelab + ports: + - 8080:80 + - 8443:443 + environment: + - CADDY_INGRESS_NETWORKS=dmz + # If you are not using Podman, comment the following line + - CADDY_DOCKER_NO_SCOPE=true + env_file: .env + networks: + - dmz + volumes: + - ${SOCKET:-/var/run/docker.sock}:/var/run/docker.sock + - ./appdata:/data + restart: unless-stopped + labels: + # Caddy configuration (https://github.com/lucaslorentz/caddy-docker-proxy?tab=readme-ov-file#table-of-contents) + # Global ACME DNS settings + caddy.acme_dns: ovh + caddy.acme_dns.endpoint: "{env.ENDPOINT}" + caddy.acme_dns.application_key: "{env.APP_KEY}" + caddy.acme_dns.application_secret: "{env.APP_SECRET}" + caddy.acme_dns.consumer_key: "{env.CONSUMER_KEY}" + ## Debug + # caddy.log.level: DEBUG +networks: + dmz: + external: true \ No newline at end of file