Skip to content

Commit

Permalink
Add dunglas/frankenphp module
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxme committed Jul 1, 2024
1 parent 9069789 commit 17226c3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
- "frankenphp"
tags:
- 'v*.*.*'
pull_request:
Expand Down Expand Up @@ -45,9 +46,6 @@ jobs:
context: .
platforms: |
linux/amd64
linux/arm/v6
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 24 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
FROM --platform=$BUILDPLATFORM caddy:builder AS builder
FROM --platform=$BUILDPLATFORM caddy:builder AS xbuilder
FROM --platform=$BUILDPLATFORM dunglas/frankenphp:latest-builder-alpine AS builder

COPY --from=xbuilder /usr/bin/xcaddy /usr/bin/xcaddy

# https://github.com/dunglas/frankenphp/blob/main/docs/compile.md
# https://github.com/dunglas/frankenphp/issues/591
ENV CGO_ENABLED=1 XCADDY_SETCAP=1
ENV XCADDY_GO_BUILD_FLAGS="-buildmode=pie -ldflags '-w -s -extldflags \"-Wl,-z,stack-size=0x80000\"' -trimpath"
ARG TARGETOS TARGETARCH
RUN \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH xcaddy build v2.8.4 \
--output /usr/local/bin/frankenphp \
--with github.com/dunglas/[email protected]=./ \
--with github.com/dunglas/frankenphp/[email protected]=./caddy/ \
--with github.com/dunglas/[email protected] \
--with github.com/dunglas/mercure/[email protected] \
--with github.com/dunglas/vulcain/[email protected] \
--with github.com/abiosoft/caddy-exec@a42a5b2ae10fe60b6215489d56763fc9a9270a59 \
--with github.com/aksdb/caddy-cgi/v2@cddc18b229db3cbc3f45c472ad6a490a9b00f8d4 \
--with github.com/caddy-dns/cloudflare@d11ac0bfeab7475d8b89e2dc93f8c7a8b8859b8f \
Expand All @@ -20,5 +34,12 @@ RUN \
--with github.com/mholt/caddy-webdav@0f2910d52a7ea15517a288a6f3f02a5e010da845 \
--with github.com/WeidiDeng/caddy-cloudflare-ip@f53b62aa13cb7ad79c8b47aacc3f2f03989b67e5

FROM caddy:latest
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
FROM dunglas/frankenphp:latest-alpine AS runner

COPY --from=builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp

RUN install-php-extensions \
bcmath \
gd \
intl \
pdo_mysql
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ A set of [Docker images](https://hub.docker.com/r/vnxme/caddy) of Caddy for vari
- [aksdb/caddy-cgi](https://github.com/aksdb/caddy-cgi)
- [caddy-dns/cloudflare](https://github.com/caddy-dns/cloudflare)
- [caddy-dns/route53](https://github.com/caddy-dns/route53)
- [dunglas/caddy-cbrotli](github.com/dunglas/caddy-cbrotli)
- [dunglas/frankenphp](github.com/dunglas/frankenphp)
- [dunglas/mercure](github.com/dunglas/mercure)
- [dunglas/vulcain](github.com/dunglas/vulcain)
- [fvbommel/caddy-combine-ip-ranges](https://github.com/fvbommel/caddy-combine-ip-ranges)
- [fvbommel/caddy-dns-ip-range](https://github.com/fvbommel/caddy-dns-ip-range)
- [greenpau/caddy-git](https://github.com/greenpau/caddy-git)
Expand Down

0 comments on commit 17226c3

Please sign in to comment.