Skip to content

Commit

Permalink
Update Docker setup-buildx-action to v3, modify Caddyfile to support …
Browse files Browse the repository at this point in the history
…on-demand TLS and DynamoDB storage, and include caddy-mysql-storage in Dockerfile.
  • Loading branch information
nsouto committed Nov 16, 2023
1 parent 4613d5e commit b7eb361
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/caddy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
- {tag: "2.7", builder_tag: "2.7-builder", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}
- {tag: "2.7.5", builder_tag: "2.7.5-builder", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}
- {tag: "latest", builder_tag: "builder", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}

steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -68,7 +69,7 @@ jobs:
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down
1 change: 1 addition & 0 deletions caddy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM caddy:${CADDY_BUILDER_TAG} AS builder

RUN xcaddy build \
--with github.com/silinternational/certmagic-storage-dynamodb/v3 \
--with github.com/zhangjiayin/caddy-mysql-storage \
--with github.com/caddy-dns/powerdns

# TODO: Build the octane image locally and use it here, instead of pulling from dockerhub
Expand Down
30 changes: 15 additions & 15 deletions caddy/etc/caddy/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
http_port 80
https_port 443
on_demand_tls {
ask {$CADDY_ORIGIN_DOMAIN_CHECK_URL}
}

on_demand_tls {
ask {$ORIGIN_DOMAIN_CHECK_URL}
}
storage dynamodb {$CADDY_DYNAMODB_TABLE_NAME} {
aws_region {$CADDY_DYNAMODB_AWS_REGION}
}
}

storage dynamodb {$DYNAMODB_TABLE_NAME} {
aws_region {$AWS_REGION}
}
:80 {
reverse_proxy {$CADDY_ORIGIN_URL}
}

## TODO: Allow configuring multiple origin URL/Servers
: {
tls {$LETS_ENCRYPT_EMAIL} {
on_demand
dns powerdns {$POWERDNS_SERVER_URL} {$POWERDNS_API_TOKEN}
}
:443 {
tls {$CADDY_LETS_ENCRYPT_EMAIL} {
on_demand
dns powerdns {$CADDY_POWERDNS_SERVER_URL} {$CADDY_POWERDNS_API_TOKEN}
}

reverse_proxy {$ORIGIN_URL}
reverse_proxy {$CADDY_ORIGIN_URL}
}

0 comments on commit b7eb361

Please sign in to comment.