1+ ARG FRANKENPHP_VERSION='1.11.1'
2+ ARG PHP_VERSION='8.5.1'
3+
4+ FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-builder-php${PHP_VERSION}-alpine AS frankenphp_builder
5+ COPY --from=caddy:2-builder-alpine /usr/bin/xcaddy /usr/bin/xcaddy
6+ RUN CGO_ENABLED=1 \
7+ XCADDY_SETCAP=1 \
8+ XCADDY_GO_BUILD_FLAGS="-tags=nobadger,nomysql,nopgx -ldflags='-w -s -extldflags \' -Wl,-z,stack-size=0x80000\' '" \
9+ CGO_CFLAGS=$(php-config --includes) \
10+ CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
11+ xcaddy build \
12+ --output /usr/local/bin/frankenphp \
13+ --with github.com/dunglas/frankenphp=./ \
14+ --with github.com/dunglas/frankenphp/caddy=./caddy/ \
15+ --with github.com/dunglas/caddy-cbrotli \
16+ --with github.com/baldinof/caddy-supervisor
17+
18+
119FROM golang:1.25-alpine AS go_builder
220COPY ./lib/ExprCli /build
321RUN cd /build && \
@@ -6,7 +24,8 @@ RUN cd /build && \
624 go build -ldflags="-s -w" -o expr-cli main.go && \
725 upx --best --lzma expr-cli
826
9- FROM dunglas/frankenphp:1.11.1-php8.5.1-alpine AS php
27+
28+ FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine AS php
1029# see also https://github.com/opencontainers/image-spec/blob/main/annotations.md
1130LABEL org.opencontainers.image.vendor="Ember Nexus" \
1231 org.opencontainers.image.authors="Sören Klein / Syndesi <soerenklein98@gmail.com>" \
@@ -18,7 +37,10 @@ LABEL org.opencontainers.image.vendor="Ember Nexus" \
1837# Background: If the en user uses the dev mode, it is epected that he knows what he does.
1938ARG VERSION=dev
2039ENV VERSION=${VERSION}
40+ ARG FRANKENPHP_VERSION
41+ ENV FRANKENPHP_VERSION=${FRANKENPHP_VERSION}
2142
43+ COPY --from=frankenphp_builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp
2244RUN apk add --no-cache \
2345 ca-certificates \
2446 curl \
@@ -27,6 +49,7 @@ RUN apk add --no-cache \
2749# https://github.com/docker-library/php/issues/494
2850 openssl \
2951 pcre \
52+ supercronic \
3053 tar \
3154 xz \
3255 zlib \
@@ -49,12 +72,13 @@ RUN apk add --no-cache \
4972
5073COPY ./docker/Caddyfile /etc/frankenphp/Caddyfile
5174COPY ./docker/docker-entrypoint.sh /usr/local/bin/
75+ COPY ./docker/supercronic /etc/crontabs/supercronic
5276COPY --from=go_builder /build/expr-cli /usr/local/bin/expr-cli
5377RUN set -x \
5478 && chmod +x /usr/local/bin/docker-entrypoint.sh \
5579 && adduser -D worker \
5680 && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp \
57- && chown -R worker:worker /config/caddy /data/caddy
81+ && chown -R worker:worker /config/caddy /data/caddy /etc/crontabs/supercronic
5882
5983STOPSIGNAL SIGTERM
6084
@@ -103,6 +127,8 @@ LABEL org.opencontainers.image.vendor="Ember Nexus" \
103127# Background: If the en user uses the dev mode, it is epected that he knows what he does.
104128ARG VERSION=dev
105129ENV VERSION=${VERSION}
130+ ARG FRANKENPHP_VERSION
131+ ENV FRANKENPHP_VERSION=${FRANKENPHP_VERSION}
106132
107133COPY --from=production-build / /
108134
0 commit comments