2023-01-14 08:14:57 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
FROM php-base
|
2022-10-21 13:23:23 +00:00
|
|
|
|
2023-06-28 21:37:02 +00:00
|
|
|
COPY --from=golang-base /usr/local/go/bin/go /usr/local/bin/go
|
|
|
|
COPY --from=golang-base /usr/local/go /usr/local/go
|
2022-10-21 13:23:23 +00:00
|
|
|
|
2022-10-31 10:13:17 +00:00
|
|
|
RUN apk add --no-cache --virtual .build-deps \
|
|
|
|
$PHPIZE_DEPS \
|
|
|
|
argon2-dev \
|
|
|
|
coreutils \
|
|
|
|
curl-dev \
|
|
|
|
gnu-libiconv-dev \
|
|
|
|
libsodium-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
linux-headers \
|
|
|
|
oniguruma-dev \
|
|
|
|
openssl-dev \
|
|
|
|
readline-dev \
|
|
|
|
sqlite-dev
|
|
|
|
|
2022-10-21 13:23:23 +00:00
|
|
|
WORKDIR /go/src/app
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
|
|
|
|
|
|
|
|
RUN mkdir caddy && cd caddy
|
|
|
|
COPY caddy/go.mod caddy/go.sum ./caddy/
|
|
|
|
|
|
|
|
RUN cd caddy && go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
|
|
|
|
|
|
|
|
COPY *.* ./
|
|
|
|
COPY caddy caddy
|
|
|
|
COPY C-Thread-Pool C-Thread-Pool
|
|
|
|
COPY internal internal
|
|
|
|
COPY testdata testdata
|
|
|
|
|
|
|
|
# todo: automate this?
|
2023-06-28 21:37:02 +00:00
|
|
|
# see https://github.com/docker-library/php/blob/master/8.2/bookworm/zts/Dockerfile#L57-L59 for php values
|
2022-10-21 13:23:23 +00:00
|
|
|
ENV CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" CGO_CFLAGS=$PHP_CFLAGS CGO_CPPFLAGS=$PHP_CPPFLAGS
|
|
|
|
|
|
|
|
RUN cd caddy/frankenphp && \
|
|
|
|
go build && \
|
|
|
|
cp frankenphp /usr/local/bin && \
|
|
|
|
cp /go/src/app/caddy/frankenphp/Caddyfile /etc/Caddyfile
|
|
|
|
|
2022-10-21 15:39:50 +00:00
|
|
|
ENTRYPOINT ["/bin/sh","-c"]
|