From 526fee4792e4ca2b267189deaab30c393ac64959 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Mon, 12 Aug 2024 16:38:24 -0700 Subject: [PATCH] Init dungeon-master traefik instance for testing nested Traefik reverse proxies. --- homelab/dungeon-master/.gitignore | 2 ++ homelab/dungeon-master/README.md | 3 ++ .../local-ai/docker-compose.yml | 36 +++++++++++++++++++ homelab/dungeon-master/local-ai/traefik.yaml | 29 +++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 homelab/dungeon-master/.gitignore create mode 100644 homelab/dungeon-master/README.md create mode 100644 homelab/dungeon-master/local-ai/docker-compose.yml create mode 100644 homelab/dungeon-master/local-ai/traefik.yaml diff --git a/homelab/dungeon-master/.gitignore b/homelab/dungeon-master/.gitignore new file mode 100644 index 00000000..df5557a5 --- /dev/null +++ b/homelab/dungeon-master/.gitignore @@ -0,0 +1,2 @@ +*_secret.txt +acme.json \ No newline at end of file diff --git a/homelab/dungeon-master/README.md b/homelab/dungeon-master/README.md new file mode 100644 index 00000000..eba8109c --- /dev/null +++ b/homelab/dungeon-master/README.md @@ -0,0 +1,3 @@ +# Dungeon Master +This directory contains homelab stuff related to my desktop. Being the ship of Theseus that it is, I'm not going to include an inxi hardware report. + diff --git a/homelab/dungeon-master/local-ai/docker-compose.yml b/homelab/dungeon-master/local-ai/docker-compose.yml new file mode 100644 index 00000000..c08412f4 --- /dev/null +++ b/homelab/dungeon-master/local-ai/docker-compose.yml @@ -0,0 +1,36 @@ +services: + traefik: + image: traefik:latest + container_name: traefik + restart: "no" + networks: + web: + ports: + - 80:80 + - 443:443 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - ./traefik.yaml:/traefik.yaml + - ./acme.json:/acme.json + secrets: + - cloudflare_token + environment: + - CF_DNS_API_TOKEN=/run/secrets/cloudflare_token + + nginx: + image: nginx + container_name: nginx + restart: "no" + networks: + - web + labels: + - traefik.http.routers.nginx.rule=Host(`nginx.ai.jafner.net`) + - traefik.http.routers.nginx.tls.certresolver=lets-encrypt + +networks: + web: + external: true + +secrets: + cloudflare_token: + file: ./cloudflare_secret.txt \ No newline at end of file diff --git a/homelab/dungeon-master/local-ai/traefik.yaml b/homelab/dungeon-master/local-ai/traefik.yaml new file mode 100644 index 00000000..cd62f08f --- /dev/null +++ b/homelab/dungeon-master/local-ai/traefik.yaml @@ -0,0 +1,29 @@ +entryPoints: + web: + address: :80 + http: + redirections: + entryPoint: + to: websecure + scheme: https + websecure: + address: :443 + +certificatesResolvers: + lets-encrypt: + acme: + email: jafner425@gmail.com + storage: acme.json + caserver: https://acme-staging-v02.api.letsencrypt.org/directory + dnsChallenge: + provider: cloudflare + resolvers: + - "1.1.1.1:53" + - "8.8.8.8:53" + # CF_DNS_API_TOKEN + +providers: + docker: + endpoint: "unix:///var/run/docker.sock" + watch: true + network: web \ No newline at end of file