20 lines
746 B
Docker
20 lines
746 B
Docker
FROM dunglas/frankenphp:builder AS builder
|
|
|
|
COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy
|
|
|
|
RUN CGO_ENABLED=1 \
|
|
XCADDY_SETCAP=1 \
|
|
XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \
|
|
CGO_CFLAGS=$(php-config --includes) \
|
|
CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
|
|
xcaddy build \
|
|
--output /usr/local/bin/frankenphp \
|
|
--with github.com/dunglas/frankenphp=./ \
|
|
--with github.com/dunglas/frankenphp/caddy=./caddy/ #$XCADDY_APPS
|
|
|
|
FROM dunglas/frankenphp AS runner
|
|
|
|
COPY --from=builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp
|
|
RUN ln -s /usr/local/bin/caddy /usr/local/bin/frankenphp
|
|
|
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|