add: caddy

This commit is contained in:
Nite07 2024-11-05 09:48:13 +08:00
parent 0c51061149
commit a17c48848d
2 changed files with 50 additions and 0 deletions

31
.github/workflows/docker-caddy.yml vendored Normal file
View File

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

19
caddy/Dockerfile Normal file
View File

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