From 33a36839867ea26109fc81adb808c15bdd364017 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Sun, 1 Jan 2023 03:59:14 +0900 Subject: [PATCH] create caddy-docker-proxy --- caddy-docker-proxy/Dockerfile | 5 +++++ caddy-docker-proxy/compose.yml | 16 ++++++++++++++++ caddy-docker-proxy/nginx/compose.yml | 11 +++++++++++ 3 files changed, 32 insertions(+) create mode 100644 caddy-docker-proxy/Dockerfile create mode 100644 caddy-docker-proxy/compose.yml create mode 100644 caddy-docker-proxy/nginx/compose.yml diff --git a/caddy-docker-proxy/Dockerfile b/caddy-docker-proxy/Dockerfile new file mode 100644 index 0000000..1d128aa --- /dev/null +++ b/caddy-docker-proxy/Dockerfile @@ -0,0 +1,5 @@ +FROM caddy:2.6.2-builder-alpine AS builder +RUN xcaddy build --with github.com/lucaslorentz/caddy-docker-proxy/v2 +FROM caddy:2.6.2-alpine +COPY --from=builder /usr/bin/caddy /usr/bin/caddy +CMD ["caddy", "docker-proxy", "--ingress-networks=caddy"] diff --git a/caddy-docker-proxy/compose.yml b/caddy-docker-proxy/compose.yml new file mode 100644 index 0000000..dfc9b95 --- /dev/null +++ b/caddy-docker-proxy/compose.yml @@ -0,0 +1,16 @@ +services: + caddy-docker-proxy: + image: fogtype/caddy-docker-proxy + build: "." + ports: + - "8080:80" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - caddy_data:/data + - caddy_config:/config +networks: + default: + name: caddy +volumes: + caddy_data: + caddy_config: diff --git a/caddy-docker-proxy/nginx/compose.yml b/caddy-docker-proxy/nginx/compose.yml new file mode 100644 index 0000000..0646148 --- /dev/null +++ b/caddy-docker-proxy/nginx/compose.yml @@ -0,0 +1,11 @@ +services: + nginx: + image: nginx:alpine + networks: + - caddy + labels: + caddy: http://nginx.localhost + caddy.reverse_proxy: "{{ upstreams }}" +networks: + caddy: + external: true