diff --git a/Docker/Caddy/Another/Dockerfile b/Docker/Caddy/Another/Dockerfile new file mode 100644 index 0000000..38d22b4 --- /dev/null +++ b/Docker/Caddy/Another/Dockerfile @@ -0,0 +1,10 @@ +FROM caddy:builder AS builder + +RUN xcaddy build \ + --with github.com/hslatman/caddy-crowdsec-bouncer \ + --with github.com/mholt/caddy-events-exec \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 +FROM caddy:latest + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + diff --git a/Docker/Caddy/Another/Dockerfile.2 b/Docker/Caddy/Another/Dockerfile.2 new file mode 100644 index 0000000..e2a9ca1 --- /dev/null +++ b/Docker/Caddy/Another/Dockerfile.2 @@ -0,0 +1,19 @@ +# Stage 1: Build Caddy with required plugins +FROM golang:latest AS builder + +# Enable Go Modules and set Go proxy to avoid direct GitHub calls +ENV GO111MODULE=on +ENV GOPROXY=https://proxy.golang.org,direct + +# Install xcaddy +RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest + +# Build Caddy with required plugins +RUN xcaddy build \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 \ + --with github.com/crowdsecurity/caddy-bouncer/v2 +# Stage 2: Create final lightweight image +FROM caddy:latest + +# Copy built Caddy binary from builder stage +COPY --from=builder /go/bin/caddy /usr/bin/caddy diff --git a/Docker/Caddy/Another/Dockerfile.old b/Docker/Caddy/Another/Dockerfile.old new file mode 100644 index 0000000..35fd7ee --- /dev/null +++ b/Docker/Caddy/Another/Dockerfile.old @@ -0,0 +1,20 @@ +FROM golang:latest AS builder + +# Enable Go Modules and force Go proxy usage +ENV GO111MODULE=on +ENV GOPROXY=https://proxy.golang.org,direct + +# Install xcaddy +RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest + +# Build Caddy with required plugins +RUN xcaddy build \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 \ + --with github.com/crowdsecurity/caddy-bouncer + +# Create a lightweight final image +FROM caddy:latest + +# Copy built Caddy binary from the builder stage +COPY --from=builder /go/bin/caddy /usr/bin/caddy + diff --git a/Docker/Caddy/Another/go-modules.tar.gz b/Docker/Caddy/Another/go-modules.tar.gz new file mode 100644 index 0000000..7feb0a5 Binary files /dev/null and b/Docker/Caddy/Another/go-modules.tar.gz differ diff --git a/Docker/Caddy/Another/go.mod b/Docker/Caddy/Another/go.mod new file mode 100644 index 0000000..4dcbc23 --- /dev/null +++ b/Docker/Caddy/Another/go.mod @@ -0,0 +1,3 @@ +module tempmod + +go 1.24.1 diff --git a/Docker/Caddy/DockerFile b/Docker/Caddy/DockerFile new file mode 100644 index 0000000..1982039 --- /dev/null +++ b/Docker/Caddy/DockerFile @@ -0,0 +1,16 @@ +FROM golang:latest AS builder + +# Install xcaddy +RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest + +# Build Caddy with necessary plugins +RUN xcaddy build \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 \ + --with github.com/crowdsecurity/caddy-bouncer + +# Create a lightweight final image +FROM caddy:latest + +# Copy built Caddy binary from the builder stage +COPY --from=builder /go/bin/caddy /usr/bin/caddy + diff --git a/caddy.yaml b/caddy.yaml index 29edd21..824a45d 100755 --- a/caddy.yaml +++ b/caddy.yaml @@ -6,8 +6,8 @@ configs: services: caddy: - # image: lucaslorentz/caddy-docker-proxy:ci-alpine - image: ghcr.io/serfriz/caddy-crowdsec:latest + image: lucaslorentz/caddy-docker-proxy:ci-alpine + #image: ghcr.io/serfriz/caddy-crowdsec:latest ports: - 80:80 - 443:443