-
Notifications
You must be signed in to change notification settings - Fork 457
Expand file tree
/
Copy pathdev-alpine.Dockerfile
More file actions
90 lines (82 loc) · 1.79 KB
/
dev-alpine.Dockerfile
File metadata and controls
90 lines (82 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
FROM golang:1.26-alpine
ENV GOTOOLCHAIN=local
ENV CFLAGS="-ggdb3"
ENV PHPIZE_DEPS="\
autoconf \
dpkg-dev \
file \
g++ \
gcc \
libc-dev \
make \
pkgconfig \
re2c"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# hadolint ignore=SC2086
RUN <<EOF
apk add --no-cache \
$PHPIZE_DEPS \
argon2-dev \
brotli-dev \
curl-dev \
oniguruma-dev \
readline-dev \
libsodium-dev \
sqlite-dev \
openssl-dev \
libxml2-dev \
zlib-dev \
bison \
nss-tools \
libstdc++ \
linux-headers \
git \
clang \
cmake \
llvm \
gdb \
valgrind \
neovim \
zsh \
libtool
echo 'set auto-load safe-path /' > /root/.gdbinit
EOF
WORKDIR /usr/local/src/php
RUN <<EOF
git clone --branch=PHP-8.5 https://github.com/php/php-src.git .
# --enable-embed is necessary to generate libphp.so, but we don't use this SAPI directly
./buildconf --force
EXTENSION_DIR=/usr/lib/frankenphp/modules ./configure \
--enable-embed \
--enable-zts \
--disable-zend-signals \
--enable-zend-max-execution-timers \
--with-config-file-path=/etc/frankenphp/php.ini \
--with-config-file-scan-dir=/etc/frankenphp/php.d \
--enable-debug
make -j"$(nproc)"
make install
ldconfig /etc/ld.so.conf.d
mkdir -p /etc/frankenphp/php.d
cp php.ini-development /etc/frankenphp/php.ini
echo "zend_extension=opcache.so" >> /etc/frankenphp/php.ini
echo "opcache.enable=1" >> /etc/frankenphp/php.ini
php --version
EOF
# Install e-dant/watcher (necessary for file watching)
WORKDIR /usr/local/src/watcher
RUN <<EOF
git clone https://github.com/e-dant/watcher .
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/
cmake --install build
EOF
WORKDIR /go/src/app
COPY . .
WORKDIR /go/src/app/caddy/frankenphp
RUN ../../go.sh build -buildvcs=false
WORKDIR /go/src/app
CMD [ "zsh" ]