docs(caddy): update documentation with remote Dockerfile build (#442)

* docs(caddy): update documentation with remote Dockerfile build

* update doc version script
This commit is contained in:
Alexis Couvreur
2024-11-05 23:46:11 -05:00
committed by GitHub
parent a958703db7
commit 6c25b10a48
4 changed files with 19 additions and 26 deletions

View File

@@ -61,7 +61,7 @@ update-doc-version:
update-doc-version-middleware: 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' {} +
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 sed -i 's/v$(LAST)/v$(NEXT)/g' plugins/caddy/README.md
.PHONY: docs .PHONY: docs

View File

@@ -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

View File

@@ -15,24 +15,20 @@ Here I'll show you two options with Docker.
### By using the provided Dockerfile ### By using the provided Dockerfile
``` ```bash
docker build https://github.com/sablierapp/sablier.git#v1.8.1-beta.22:plugins/caddy docker build https://github.com/sablierapp/sablier.git#v1.8.1:plugins/caddy -t caddy:with-sablier
--build-arg=CADDY_VERSION=2.6.4
-t caddy:2.6.4-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 ### By updating your Caddy Dockerfile
``` ```Dockerfile
ARG CADDY_VERSION=2.6.4 ARG CADDY_VERSION=2.8.4
FROM caddy:${CADDY_VERSION}-builder AS builder FROM caddy:${CADDY_VERSION}-builder AS builder
ADD https://github.com/sablierapp/sablier.git#v1.8.1-beta.22 /sablier
RUN xcaddy build \ RUN xcaddy build \
--with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy --with github.com/sablierapp/sablier/plugins/caddy
FROM caddy:${CADDY_VERSION} FROM caddy:${CADDY_VERSION}
@@ -43,7 +39,7 @@ COPY --from=builder /usr/bin/caddy /usr/bin/caddy
You can have the following configuration: You can have the following configuration:
``` ```Caddyfile
:80 { :80 {
route /my/route { route /my/route {
sablier [<sablierURL>=http://sablier:10000] { sablier [<sablierURL>=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. Almost all options are optional and you can setup very simple rules to use the server default values.
``` ```Caddyfile
:80 { :80 {
route /my/route { route /my/route {
sablier { 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 1. Build local sablier
`docker build -t caddy:local .` `docker build -t caddy:local .`

View File

@@ -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