Skip to content

Commit a3457be

Browse files
committed
WSC Dockerfile
some changes
1 parent 41e46bd commit a3457be

File tree

4 files changed

+286
-132
lines changed

4 files changed

+286
-132
lines changed

dhi.alpine.fpm.wsc.Dockerfile

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# build: docker build --no-cache --progress=plain --build-arg PHP_VERSION=8.4 -t docker.io/tobi312/php:8.4-dhi-fpm-alpine-wsc -f dhi.alpine.fpm.wsc.Dockerfile .
2-
# check: docker run --rm --name phptest -it docker.io/tobi312/php:8.4-dhi-fpm-alpine-wsc -m
2+
# check: docker run --rm --name phpcheck -it docker.io/tobi312/php:8.4-dhi-fpm-alpine-wsc -m
3+
# https://github.com/Tob1as/docker-php
4+
#
35
# https://hub.docker.com/hardened-images/catalog/dhi/php | short: https://dhi.io/catalog/php
46
# https://github.com/docker-hardened-images/catalog
7+
#
8+
# WSC = WoltLab Suite Core <https://www.woltlab.com/en/>
9+
# PHP Extensions Requirements:
10+
# - https://manual.woltlab.com/en/requirements/#php-extensions
11+
# - https://manual.woltlab.com/en/elasticsearch/#system-requirements
12+
# - https://manual.woltlab.com/en/ldap/#system-requirements
13+
# Note: Some PHP Extensions/Modules are installed by default:
14+
# ctype curl dom intl libxml mbstring openssl opcache PDO zlib
15+
# These are still needed: exif gd gmp imagick ldap pdo_mysql redis
16+
#
517
ARG PHP_VERSION=8.4
618
ARG BUILD_PHP_VERSION=${PHP_VERSION}
719
ARG BUILD_OS=alpine3.22
@@ -21,20 +33,20 @@ WORKDIR /tmp
2133

2234
# Install required system libraries for building PHP extensions
2335
RUN apk add --no-cache \
24-
git \
25-
unzip \
26-
autoconf \
27-
build-base \
28-
linux-headers \
29-
libjpeg-turbo-dev \
30-
libpng-dev \
31-
libwebp-dev \
32-
libxpm-dev \
33-
freetype-dev \
34-
icu-dev \
35-
openldap-dev \
36-
gmp-dev \
37-
imagemagick-dev
36+
git \
37+
unzip \
38+
autoconf \
39+
build-base \
40+
linux-headers \
41+
libjpeg-turbo-dev \
42+
libpng-dev \
43+
libwebp-dev \
44+
libxpm-dev \
45+
freetype-dev \
46+
icu-dev \
47+
openldap-dev \
48+
gmp-dev \
49+
imagemagick-dev
3850

3951
# =========================
4052
# Preparation:
@@ -54,36 +66,41 @@ RUN echo "" \
5466
# Core PHP Extensions
5567
# =========================
5668

57-
# gd
58-
RUN cd $PHP_SRC_DIR/ext/gd \
69+
# exif
70+
RUN cd $PHP_SRC_DIR/ext/exif \
5971
&& phpize \
60-
&& ./configure --with-webp --with-jpeg --with-xpm --with-freetype \
72+
&& ./configure \
6173
&& make -j$(nproc) \
6274
&& make install
6375

64-
# pdo_mysql
65-
RUN cd $PHP_SRC_DIR/ext/pdo_mysql \
76+
# gd
77+
RUN cd $PHP_SRC_DIR/ext/gd \
6678
&& phpize \
6779
&& ./configure \
80+
#--with-avif \
81+
--with-freetype \
82+
--with-jpeg \
83+
--with-webp \
84+
#--with-xpm \
6885
&& make -j$(nproc) \
6986
&& make install
7087

71-
# ldap
72-
RUN cd $PHP_SRC_DIR/ext/ldap \
88+
# gmp
89+
RUN cd $PHP_SRC_DIR/ext/gmp \
7390
&& phpize \
7491
&& ./configure \
7592
&& make -j$(nproc) \
7693
&& make install
7794

78-
# gmp
79-
RUN cd $PHP_SRC_DIR/ext/gmp \
95+
# ldap
96+
RUN cd $PHP_SRC_DIR/ext/ldap \
8097
&& phpize \
8198
&& ./configure \
8299
&& make -j$(nproc) \
83100
&& make install
84101

85-
# exif
86-
RUN cd $PHP_SRC_DIR/ext/exif \
102+
# pdo_mysql
103+
RUN cd $PHP_SRC_DIR/ext/pdo_mysql \
87104
&& phpize \
88105
&& ./configure \
89106
&& make -j$(nproc) \
@@ -94,37 +111,39 @@ RUN cd $PHP_SRC_DIR/ext/exif \
94111
# =========================
95112
WORKDIR /tmp
96113

97-
# Redis <https://github.com/phpredis/phpredis/>
98-
RUN pecl download redis \
99-
&& tar xzf redis-*.tgz \
100-
&& rm redis-*.tgz \
101-
&& cd redis-* \
114+
# Imagick <https://github.com/Imagick/imagick>
115+
RUN pecl download imagick \
116+
&& tar xzf imagick-*.tgz \
117+
&& rm imagick-*.tgz \
118+
&& cd imagick-* \
102119
&& phpize \
103120
&& ./configure \
104121
&& make -j$(nproc) \
105122
&& make install \
106123
&& cd ..
107124

108-
# Imagick <https://github.com/Imagick/imagick>
109-
RUN pecl download imagick \
110-
&& tar xzf imagick-*.tgz \
111-
&& rm imagick-*.tgz \
112-
&& cd imagick-* \
125+
# Redis <https://github.com/phpredis/phpredis/>
126+
RUN pecl download redis \
127+
&& tar xzf redis-*.tgz \
128+
&& rm redis-*.tgz \
129+
&& cd redis-* \
113130
&& phpize \
114131
&& ./configure \
115132
&& make -j$(nproc) \
116133
&& make install \
117134
&& cd ..
118-
135+
136+
# =========================
119137
# Enable all extensions
138+
# =========================
120139
RUN echo "" \
140+
&& echo "extension=exif.so" > $PHP_INI_DIR/conf.d/docker-php-ext-exif.ini \
121141
&& echo "extension=gd.so" > $PHP_INI_DIR/conf.d/docker-php-ext-gd.ini \
122-
&& echo "extension=pdo_mysql.so" > $PHP_INI_DIR/conf.d/docker-php-ext-pdo_mysql.ini \
123-
&& echo "extension=ldap.so" > $PHP_INI_DIR/conf.d/docker-php-ext-ldap.ini \
124142
&& echo "extension=gmp.so" > $PHP_INI_DIR/conf.d/docker-php-ext-gmp.ini \
125-
&& echo "extension=exif.so" > $PHP_INI_DIR/conf.d/docker-php-ext-exif.ini \
126-
&& echo "extension=redis.so" > $PHP_INI_DIR/conf.d/docker-php-ext-redis.ini \
143+
&& echo "extension=ldap.so" > $PHP_INI_DIR/conf.d/docker-php-ext-ldap.ini \
144+
&& echo "extension=pdo_mysql.so" > $PHP_INI_DIR/conf.d/docker-php-ext-pdo_mysql.ini \
127145
&& echo "extension=imagick.so" > $PHP_INI_DIR/conf.d/docker-php-ext-imagick.ini \
146+
&& echo "extension=redis.so" > $PHP_INI_DIR/conf.d/docker-php-ext-redis.ini \
128147
&& echo ""
129148

130149
# =========================

dhi.debian.fpm.wsc.Dockerfile

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# build: docker build --no-cache --progress=plain --build-arg PHP_VERSION=8.4 -t docker.io/tobi312/php:8.4-dhi-fpm-debian-wsc -f dhi.debian.fpm.wsc.Dockerfile .
2-
# check: docker run --rm --name phptest -it docker.io/tobi312/php:8.4-dhi-fpm-debian-wsc -m
2+
# check: docker run --rm --name phpcheck -it docker.io/tobi312/php:8.4-dhi-fpm-debian-wsc -m
3+
# https://github.com/Tob1as/docker-php
4+
#
35
# https://hub.docker.com/hardened-images/catalog/dhi/php | short: https://dhi.io/catalog/php
46
# https://github.com/docker-hardened-images/catalog
7+
#
8+
# WSC = WoltLab Suite Core <https://www.woltlab.com/en/>
9+
# PHP Extensions Requirements:
10+
# - https://manual.woltlab.com/en/requirements/#php-extensions
11+
# - https://manual.woltlab.com/en/elasticsearch/#system-requirements
12+
# - https://manual.woltlab.com/en/ldap/#system-requirements
13+
# Note: Some PHP Extensions/Modules are installed by default:
14+
# ctype curl dom intl libxml mbstring openssl opcache PDO zlib
15+
# These are still needed: exif gd gmp imagick ldap pdo_mysql redis
16+
#
517
ARG PHP_VERSION=8.4
618
ARG BUILD_PHP_VERSION=${PHP_VERSION}
719
ARG BUILD_OS=debian13
@@ -55,36 +67,41 @@ RUN echo "" \
5567
# Core PHP Extensions
5668
# =========================
5769

58-
# gd
59-
RUN cd $PHP_SRC_DIR/ext/gd \
70+
# exif
71+
RUN cd $PHP_SRC_DIR/ext/exif \
6072
&& phpize \
61-
&& ./configure --with-webp --with-jpeg --with-xpm --with-freetype \
73+
&& ./configure \
6274
&& make -j$(nproc) \
6375
&& make install
6476

65-
# pdo_mysql
66-
RUN cd $PHP_SRC_DIR/ext/pdo_mysql \
77+
# gd
78+
RUN cd $PHP_SRC_DIR/ext/gd \
6779
&& phpize \
6880
&& ./configure \
81+
#--with-avif \
82+
--with-freetype \
83+
--with-jpeg \
84+
--with-webp \
85+
#--with-xpm \
6986
&& make -j$(nproc) \
7087
&& make install
7188

72-
# ldap
73-
RUN cd $PHP_SRC_DIR/ext/ldap \
89+
# gmp
90+
RUN cd $PHP_SRC_DIR/ext/gmp \
7491
&& phpize \
7592
&& ./configure \
7693
&& make -j$(nproc) \
7794
&& make install
7895

79-
# gmp
80-
RUN cd $PHP_SRC_DIR/ext/gmp \
96+
# ldap
97+
RUN cd $PHP_SRC_DIR/ext/ldap \
8198
&& phpize \
8299
&& ./configure \
83100
&& make -j$(nproc) \
84101
&& make install
85102

86-
# exif
87-
RUN cd $PHP_SRC_DIR/ext/exif \
103+
# pdo_mysql
104+
RUN cd $PHP_SRC_DIR/ext/pdo_mysql \
88105
&& phpize \
89106
&& ./configure \
90107
&& make -j$(nproc) \
@@ -95,37 +112,39 @@ RUN cd $PHP_SRC_DIR/ext/exif \
95112
# =========================
96113
WORKDIR /tmp
97114

98-
# Redis <https://github.com/phpredis/phpredis/>
99-
RUN pecl download redis \
100-
&& tar xzf redis-*.tgz \
101-
&& rm redis-*.tgz \
102-
&& cd redis-* \
115+
# Imagick <https://github.com/Imagick/imagick>
116+
RUN pecl download imagick \
117+
&& tar xzf imagick-*.tgz \
118+
&& rm imagick-*.tgz \
119+
&& cd imagick-* \
103120
&& phpize \
104121
&& ./configure \
105122
&& make -j$(nproc) \
106123
&& make install \
107124
&& cd ..
108125

109-
# Imagick <https://github.com/Imagick/imagick>
110-
RUN pecl download imagick \
111-
&& tar xzf imagick-*.tgz \
112-
&& rm imagick-*.tgz \
113-
&& cd imagick-* \
126+
# Redis <https://github.com/phpredis/phpredis/>
127+
RUN pecl download redis \
128+
&& tar xzf redis-*.tgz \
129+
&& rm redis-*.tgz \
130+
&& cd redis-* \
114131
&& phpize \
115132
&& ./configure \
116133
&& make -j$(nproc) \
117134
&& make install \
118135
&& cd ..
119136

137+
# =========================
120138
# Enable all extensions
139+
# =========================
121140
RUN echo "" \
141+
&& echo "extension=exif.so" > $PHP_INI_DIR/conf.d/docker-php-ext-exif.ini \
122142
&& echo "extension=gd.so" > $PHP_INI_DIR/conf.d/docker-php-ext-gd.ini \
123-
&& echo "extension=pdo_mysql.so" > $PHP_INI_DIR/conf.d/docker-php-ext-pdo_mysql.ini \
124-
&& echo "extension=ldap.so" > $PHP_INI_DIR/conf.d/docker-php-ext-ldap.ini \
125143
&& echo "extension=gmp.so" > $PHP_INI_DIR/conf.d/docker-php-ext-gmp.ini \
126-
&& echo "extension=exif.so" > $PHP_INI_DIR/conf.d/docker-php-ext-exif.ini \
127-
&& echo "extension=redis.so" > $PHP_INI_DIR/conf.d/docker-php-ext-redis.ini \
144+
&& echo "extension=ldap.so" > $PHP_INI_DIR/conf.d/docker-php-ext-ldap.ini \
145+
&& echo "extension=pdo_mysql.so" > $PHP_INI_DIR/conf.d/docker-php-ext-pdo_mysql.ini \
128146
&& echo "extension=imagick.so" > $PHP_INI_DIR/conf.d/docker-php-ext-imagick.ini \
147+
&& echo "extension=redis.so" > $PHP_INI_DIR/conf.d/docker-php-ext-redis.ini \
129148
&& echo ""
130149

131150
# =========================

0 commit comments

Comments
 (0)