Created
March 13, 2025 14:49
-
-
Save LachlanArthur/56382c6d2cb0e439219808dfb957da7f to your computer and use it in GitHub Desktop.
Revisions
-
LachlanArthur created this gist
Mar 13, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ version: "3.7" services: caddy: image: lucaslorentz/caddy-docker-proxy:ci-alpine ports: - 80:80 - 443:443 environment: - CADDY_INGRESS_NETWORKS=caddy networks: - caddy volumes: - /var/run/docker.sock:/var/run/docker.sock - caddy_data:/data restart: unless-stopped networks: caddy: external: true volumes: caddy_data: {} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ First run: create caddy network for other stacks to attach to: ```sh docker network create caddy ``` Start the proxy ```sh docker compose up ``` --- Integrating with other stacks: Add the external network: ```yml networks: caddy: external: true ``` Add the `caddy` network and labels to the services you want to proxy: ```sh services: app: networks: - default - caddy labels: caddy: example.localhost # The domain this app should use. caddy.reverse_proxy: "{{upstreams 80}}" # The internal port that the container is listening on. ```