diff --git a/Dockerfile b/Dockerfile index 29ffd44..696f73a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -288,6 +288,17 @@ RUN apk add --no-cache binutils build-base openssl-dev autoconf pcre2-dev automa FROM php-zts-base AS FRANKENPHPBUILDER +# Install e-dant/watcher (necessary for file watching) +RUN mkdir -p /usr/local/src/watcher +WORKDIR /usr/local/src/watcher +RUN apk add --no-cache binutils build-base cmake automake libtool linux-headers --virtual .watcher-build-deps \ + && wget --quiet --no-verbose https://github.com/e-dant/watcher/archive/refs/tags/0.13.2.tar.gz -O /tmp/watcher.tar.gz \ + && tar xz --strip-component=1 -xf /tmp/watcher.tar.gz \ + && cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ + && cmake --build build \ + && cmake --install build \ + && apk del --no-network .watcher-build-deps + # install caddy with frankenphp # hadolint ignore=SC2016,SC2086,DL3003 RUN apk add --no-cache go~=1.23 --virtual .go-build-deps \ @@ -299,7 +310,7 @@ RUN apk add --no-cache go~=1.23 --virtual .go-build-deps \ && sed -i -e "s/lphp/l${PHP_PACKAGE_BASENAME}/g" ../../frankenphp.go \ && export PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 `php-config --includes`" \ && export PHP_CPPFLAGS="$PHP_CFLAGS" \ - && export PHP_LDFLAGS="-Wl,-O1 -pie `php-config --ldflags`" \ + && export PHP_LDFLAGS="-Wl,-O1 -pie `php-config --ldflags` `php-config --libs`" \ && export CGO_LDFLAGS="$PHP_LDFLAGS" CGO_CFLAGS=$PHP_CFLAGS CGO_CPPFLAGS=$PHP_CPPFLAGS \ && go build \ && rm -rf /root/.cache /root/go \