From 6c25b10a48d99ae8511debaa9e71ed09236c95fe Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Tue, 5 Nov 2024 23:46:11 -0500 Subject: [PATCH] docs(caddy): update documentation with remote Dockerfile build (#442) * docs(caddy): update documentation with remote Dockerfile build * update doc version script --- Makefile | 2 +- plugins/caddy/Dockerfile.remote | 12 ------------ plugins/caddy/README.md | 22 +++++++++------------- plugins/caddy/remote.Dockerfile | 9 +++++++++ 4 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 plugins/caddy/Dockerfile.remote create mode 100644 plugins/caddy/remote.Dockerfile diff --git a/Makefile b/Makefile index aaf882f..fb7c3c6 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ update-doc-version: update-doc-version-middleware: find . -type f \( -name "*.md" -o -name "*.yml" \) -exec sed -i 's/version: "v$(LAST)"/version: "v$(NEXT)"/g' {} + find . -type f \( -name "*.md" -o -name "*.yml" \) -exec sed -i 's/version=v$(LAST)/version=v$(NEXT)/g' {} + - sed -i 's/SABLIER_VERSION=v$(LAST)/SABLIER_VERSION=v$(NEXT)/g' plugins/caddy/Dockerfile.remote + sed -i 's/SABLIER_VERSION=v$(LAST)/SABLIER_VERSION=v$(NEXT)/g' plugins/caddy/remote.Dockerfile sed -i 's/v$(LAST)/v$(NEXT)/g' plugins/caddy/README.md .PHONY: docs diff --git a/plugins/caddy/Dockerfile.remote b/plugins/caddy/Dockerfile.remote deleted file mode 100644 index 18bba56..0000000 --- a/plugins/caddy/Dockerfile.remote +++ /dev/null @@ -1,12 +0,0 @@ -ARG CADDY_VERSION=2.8.4 -ARG SABLIER_VERSION=v1.6.0 -FROM caddy:${CADDY_VERSION}-builder AS builder - -ADD https://github.com/sablierapp/sablier.git#${SABLIER_VERSION} /sablier - -RUN xcaddy build \ - --with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy - -FROM caddy:${CADDY_VERSION} - -COPY --from=builder /usr/bin/caddy /usr/bin/caddy \ No newline at end of file diff --git a/plugins/caddy/README.md b/plugins/caddy/README.md index ff8c806..4d525fc 100644 --- a/plugins/caddy/README.md +++ b/plugins/caddy/README.md @@ -15,24 +15,20 @@ Here I'll show you two options with Docker. ### By using the provided Dockerfile -``` -docker build https://github.com/sablierapp/sablier.git#v1.8.1-beta.22:plugins/caddy - --build-arg=CADDY_VERSION=2.6.4 - -t caddy:2.6.4-with-sablier +```bash +docker build https://github.com/sablierapp/sablier.git#v1.8.1:plugins/caddy -t caddy:with-sablier ``` -**Note:** You can change `main` for any other branch (such as `beta`, or tags `v1.8.1-beta.22`) +**Note:** You can change `main` for any other branch (such as `beta`, or tags `v1.8.1`) ### By updating your Caddy Dockerfile -``` -ARG CADDY_VERSION=2.6.4 +```Dockerfile +ARG CADDY_VERSION=2.8.4 FROM caddy:${CADDY_VERSION}-builder AS builder -ADD https://github.com/sablierapp/sablier.git#v1.8.1-beta.22 /sablier - RUN xcaddy build \ - --with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy + --with github.com/sablierapp/sablier/plugins/caddy FROM caddy:${CADDY_VERSION} @@ -43,7 +39,7 @@ COPY --from=builder /usr/bin/caddy /usr/bin/caddy You can have the following configuration: -``` +```Caddyfile :80 { route /my/route { sablier [=http://sablier:10000] { @@ -69,7 +65,7 @@ You can have the following configuration: Almost all options are optional and you can setup very simple rules to use the server default values. -``` +```Caddyfile :80 { route /my/route { sablier { @@ -81,7 +77,7 @@ Almost all options are optional and you can setup very simple rules to use the s } ``` -## Running end to end tests +## Running end-to-end tests 1. Build local sablier `docker build -t caddy:local .` diff --git a/plugins/caddy/remote.Dockerfile b/plugins/caddy/remote.Dockerfile new file mode 100644 index 0000000..bada2ec --- /dev/null +++ b/plugins/caddy/remote.Dockerfile @@ -0,0 +1,9 @@ +ARG CADDY_VERSION=2.8.4 +FROM caddy:${CADDY_VERSION}-builder AS builder + +RUN xcaddy build \ + --with github.com/sablierapp/sablier/plugins/caddy + +FROM caddy:${CADDY_VERSION} + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy \ No newline at end of file