From a17c48848d710890f9010d68a2c8f33be845df6a Mon Sep 17 00:00:00 2001 From: nite07 Date: Tue, 5 Nov 2024 09:48:13 +0800 Subject: [PATCH] add: caddy --- .github/workflows/docker-caddy.yml | 31 ++++++++++++++++++++++++++++++ caddy/Dockerfile | 19 ++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/docker-caddy.yml create mode 100644 caddy/Dockerfile diff --git a/.github/workflows/docker-caddy.yml b/.github/workflows/docker-caddy.yml new file mode 100644 index 0000000..fbba805 --- /dev/null +++ b/.github/workflows/docker-caddy.yml @@ -0,0 +1,31 @@ +name: docker-caddy + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: nite07/caddy:latest + platforms: linux/amd64 + context: ./caddy diff --git a/caddy/Dockerfile b/caddy/Dockerfile new file mode 100644 index 0000000..ce5377d --- /dev/null +++ b/caddy/Dockerfile @@ -0,0 +1,19 @@ +FROM caddy:builder AS builder + +RUN xcaddy build \ + --with github.com/caddyserver/nginx-adapter \ + --with github.com/caddy-dns/cloudflare \ + --with github.com/caddyserver/replace-response \ + --with github.com/mholt/caddy-webdav \ + --with github.com/mholt/caddy-ratelimit \ + --with github.com/WeidiDeng/caddy-cloudflare-ip \ + --with github.com/porech/caddy-maxmind-geolocation \ + --with github.com/mholt/caddy-l4/layer4 + +FROM caddy:latest + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + + + +