2023-09-19 14:44:50 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
2024-08-04 12:05:54 +00:00
|
|
|
#checkov:skip=CKV_DOCKER_2
|
|
|
|
#checkov:skip=CKV_DOCKER_3
|
2024-02-12 09:00:46 +00:00
|
|
|
FROM golang:1.22-alpine
|
2023-09-19 14:44:50 +00:00
|
|
|
|
|
|
|
ENV CFLAGS="-ggdb3"
|
2024-07-05 09:09:09 +00:00
|
|
|
ENV PHPIZE_DEPS="\
|
2024-01-29 13:41:32 +00:00
|
|
|
autoconf \
|
|
|
|
dpkg-dev \
|
|
|
|
file \
|
|
|
|
g++ \
|
|
|
|
gcc \
|
|
|
|
libc-dev \
|
|
|
|
make \
|
|
|
|
pkgconfig \
|
2024-07-05 09:09:09 +00:00
|
|
|
re2c"
|
2023-09-19 14:44:50 +00:00
|
|
|
|
2024-10-07 11:17:24 +00:00
|
|
|
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
|
|
|
|
2023-09-19 14:44:50 +00:00
|
|
|
RUN apk add --no-cache \
|
2024-01-29 13:41:32 +00:00
|
|
|
$PHPIZE_DEPS \
|
|
|
|
argon2-dev \
|
2024-01-30 17:33:59 +00:00
|
|
|
brotli-dev \
|
2024-01-29 13:41:32 +00:00
|
|
|
curl-dev \
|
|
|
|
oniguruma-dev \
|
|
|
|
readline-dev \
|
|
|
|
libsodium-dev \
|
|
|
|
sqlite-dev \
|
|
|
|
openssl-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
zlib-dev \
|
|
|
|
bison \
|
|
|
|
nss-tools \
|
2024-10-07 11:17:24 +00:00
|
|
|
# file watcher
|
|
|
|
libstdc++ \
|
|
|
|
linux-headers \
|
2024-01-29 13:41:32 +00:00
|
|
|
# Dev tools \
|
|
|
|
git \
|
|
|
|
clang \
|
2024-10-31 08:39:51 +00:00
|
|
|
cmake \
|
2024-01-29 13:41:32 +00:00
|
|
|
llvm \
|
|
|
|
gdb \
|
|
|
|
valgrind \
|
|
|
|
neovim \
|
|
|
|
zsh \
|
|
|
|
libtool && \
|
|
|
|
echo 'set auto-load safe-path /' > /root/.gdbinit
|
2023-09-19 14:44:50 +00:00
|
|
|
|
2023-12-01 16:26:21 +00:00
|
|
|
WORKDIR /usr/local/src/php
|
|
|
|
RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
|
2024-01-29 13:41:32 +00:00
|
|
|
# --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
|
|
|
|
./buildconf --force && \
|
|
|
|
./configure \
|
|
|
|
--enable-embed \
|
|
|
|
--enable-zts \
|
|
|
|
--disable-zend-signals \
|
|
|
|
--enable-zend-max-execution-timers \
|
|
|
|
--enable-debug && \
|
|
|
|
make -j"$(nproc)" && \
|
|
|
|
make install && \
|
|
|
|
ldconfig /etc/ld.so.conf.d && \
|
|
|
|
cp php.ini-development /usr/local/lib/php.ini && \
|
|
|
|
echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
|
|
|
|
echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
|
|
|
|
php --version
|
2023-09-19 14:44:50 +00:00
|
|
|
|
2024-10-31 08:39:51 +00:00
|
|
|
# Install e-dant/watcher (necessary for file watching)
|
2024-10-11 15:37:53 +00:00
|
|
|
ARG EDANT_WATCHER_VERSION=release
|
2024-10-07 11:17:24 +00:00
|
|
|
WORKDIR /usr/local/src/watcher
|
2024-10-31 08:39:51 +00:00
|
|
|
RUN git clone --branch=$EDANT_WATCHER_VERSION https://github.com/e-dant/watcher . && \
|
|
|
|
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
|
|
|
|
cmake --build build/ && \
|
|
|
|
cmake --install build
|
2024-10-07 11:17:24 +00:00
|
|
|
|
2023-09-19 14:44:50 +00:00
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY . .
|
|
|
|
|
2023-12-01 16:26:21 +00:00
|
|
|
WORKDIR /go/src/app/caddy/frankenphp
|
|
|
|
RUN go build
|
2023-09-19 14:44:50 +00:00
|
|
|
|
2023-12-01 16:26:21 +00:00
|
|
|
WORKDIR /go/src/app
|
2023-09-19 14:44:50 +00:00
|
|
|
CMD [ "zsh" ]
|