-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
99 lines (83 loc) · 2.33 KB
/
Dockerfile
File metadata and controls
99 lines (83 loc) · 2.33 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
91
92
93
94
95
96
97
98
# Dockerfile for building and testing Signalforge HTTP extension
# Mirrors php-builds approach: compiles PHP from source then builds extension
#
# Build args:
# PHP_VERSION - PHP version (8.3, 8.4, 8.5) - defaults to 8.5
#
ARG PHP_VERSION=8.5
FROM ubuntu:24.04
ARG PHP_VERSION
ENV DEBIAN_FRONTEND=noninteractive
LABEL maintainer="Signalforge Team"
LABEL description="PHP ${PHP_VERSION} with signalforge_http extension"
LABEL php.version="${PHP_VERSION}"
# Install build dependencies
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
git \
gcc \
g++ \
make \
autoconf \
automake \
libtool \
pkg-config \
re2c \
bison \
wget \
libxml2-dev \
libssl-dev \
libcurl4-openssl-dev \
libzip-dev \
libonig-dev \
libsqlite3-dev \
libpq-dev \
libreadline-dev \
libpcre2-dev \
libsodium-dev \
zlib1g-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Clone and build PHP from source
WORKDIR /tmp
RUN MAJOR=$(echo ${PHP_VERSION} | cut -d. -f1); \
MINOR=$(echo ${PHP_VERSION} | cut -d. -f2); \
PHP_BRANCH="PHP-${MAJOR}.${MINOR}"; \
git clone --depth 1 --branch ${PHP_BRANCH} --quiet https://github.com/php/php-src.git
WORKDIR /tmp/php-src
RUN ./buildconf --force > /dev/null
RUN ./configure --quiet \
--prefix=/usr/local \
--with-config-file-path=/usr/local/etc/php \
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
--with-curl \
--with-openssl \
--with-zip \
--with-zlib \
--enable-mbstring \
--enable-opcache \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-mysqli \
--enable-sockets \
--enable-pcntl \
--enable-bcmath \
--with-readline
RUN make -j$(nproc)
RUN make install
# Create extension config directory
RUN mkdir -p /usr/local/etc/php/conf.d
# Copy and build http extension
WORKDIR /build
COPY . /build
RUN /usr/local/bin/phpize \
&& ./configure --enable-signalforge_http \
&& make -j$(nproc) \
&& make install
# Enable extension
RUN echo "extension=signalforge_http.so" > /usr/local/etc/php/conf.d/signalforge_http.ini
# Get run-tests.php from PHP source
RUN wget -q -O /opt/run-tests.php https://github.com/php/php-src/master/run-tests.php
# Verify extension is loaded
RUN php -m | grep signalforge_http
WORKDIR /ext
CMD ["php", "-v"]