Skip to content

Commit de71cc4

Browse files
committed
dhi changes
1 parent 60ab19a commit de71cc4

File tree

5 files changed

+42
-22
lines changed

5 files changed

+42
-22
lines changed

dhi.alpine.fpm.wsc.Dockerfile

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ RUN apk add --no-cache \
3636
gmp-dev \
3737
imagemagick-dev
3838

39+
# =========================
40+
# Preparation:
41+
# - move existing extensions, such as opcache, so that
42+
# they are not copied into the final image (again).
43+
# =========================
44+
45+
RUN mkdir -p /tmp/extension/ \
46+
#&& ls ${PHP_PREFIX}/etc/php/conf.d/ \
47+
&& mv ${PHP_PREFIX}/etc/php/conf.d/* /tmp/extension/ \
48+
&& VAR_PHP_EXTENSION_DIR=$(php -r "echo ini_get('extension_dir');") \
49+
#&& ls ${VAR_PHP_EXTENSION_DIR} \
50+
&& mv ${VAR_PHP_EXTENSION_DIR}/* /tmp/extension/ \
51+
&& ls /tmp/extension/
52+
3953
# =========================
4054
# Core PHP Extensions
4155
# =========================
@@ -80,7 +94,7 @@ RUN cd $PHP_SRC_DIR/ext/exif \
8094
# =========================
8195
WORKDIR /tmp
8296

83-
# Redis
97+
# Redis <https://github.com/phpredis/phpredis/>
8498
RUN pecl download redis \
8599
&& tar xzf redis-*.tgz \
86100
&& rm redis-*.tgz \
@@ -91,7 +105,7 @@ RUN pecl download redis \
91105
&& make install \
92106
&& cd ..
93107

94-
## Imagick
108+
# Imagick <https://github.com/Imagick/imagick>
95109
RUN pecl download imagick \
96110
&& tar xzf imagick-*.tgz \
97111
&& rm imagick-*.tgz \
@@ -113,13 +127,6 @@ RUN echo "" \
113127
&& echo "extension=imagick.so" > $PHP_INI_DIR/conf.d/docker-php-ext-imagick.ini \
114128
&& echo ""
115129

116-
## create symlinks
117-
#RUN ls -lah ${PHP_PREFIX}/lib/php/extensions/no-debug-non-zts-20240924/ \
118-
# && mkdir -p /usr/local/lib/php \
119-
# && ln -s $(php -r "echo ini_get('extension_dir');") /usr/local/lib/php/extensions \
120-
# && ls -lah $PHP_INI_DIR/conf.d/ \
121-
# && ln -s $PHP_INI_DIR/conf.d /usr/local/lib/php/conf.d
122-
123130
# =========================
124131
# Stage 2: Package extractor
125132
# =========================
@@ -153,7 +160,8 @@ RUN find /apkroot -mindepth 1 \
153160
! -path '/apkroot/usr' \
154161
! -path '/apkroot/usr/lib' \
155162
! -path '/apkroot/usr/lib/*' \
156-
-exec rm -rf {} +
163+
-exec rm -rf {} + \
164+
&& find /apkroot -type f \( -name '*.a' -o -name '*.la' \) -exec rm -f {} +
157165

158166
# List directory and file structure
159167
RUN tree /apkroot
@@ -176,6 +184,6 @@ LABEL org.opencontainers.image.authors="Tobias Hargesheimer <docker@ison.ws>" \
176184
org.opencontainers.image.source="https://github.com/Tob1as/docker-php"
177185
# Copy php extensions
178186
COPY --from=builder ${PHP_PREFIX}/lib/php/extensions/ ${PHP_PREFIX}/lib/php/extensions/
179-
COPY --from=builder ${PHP_PREFIX}/etc/php/conf.d/docker-php-ext-* ${PHP_PREFIX}/etc/php/conf.d/
187+
COPY --from=builder ${PHP_PREFIX}/etc/php/conf.d/ ${PHP_PREFIX}/etc/php/conf.d/
180188
# Copy the libraries from the extractor stage into root
181189
COPY --from=apk-extractor /apkroot /

dhi.debian.fpm.wsc.Dockerfile

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ RUN apt-get update \
3737
libmagickwand-dev \
3838
&& rm -rf /var/lib/apt/lists/*
3939

40+
# =========================
41+
# Preparation:
42+
# - move existing extensions, such as opcache, so that
43+
# they are not copied into the final image (again).
44+
# =========================
45+
46+
RUN mkdir -p /tmp/extension/ \
47+
#&& ls ${PHP_PREFIX}/etc/php/conf.d/ \
48+
&& mv ${PHP_PREFIX}/etc/php/conf.d/* /tmp/extension/ \
49+
&& VAR_PHP_EXTENSION_DIR=$(php -r "echo ini_get('extension_dir');") \
50+
#&& ls ${VAR_PHP_EXTENSION_DIR} \
51+
&& mv ${VAR_PHP_EXTENSION_DIR}/* /tmp/extension/ \
52+
&& ls /tmp/extension/
53+
4054
# =========================
4155
# Core PHP Extensions
4256
# =========================
@@ -81,7 +95,7 @@ RUN cd $PHP_SRC_DIR/ext/exif \
8195
# =========================
8296
WORKDIR /tmp
8397

84-
# Redis
98+
# Redis <https://github.com/phpredis/phpredis/>
8599
RUN pecl download redis \
86100
&& tar xzf redis-*.tgz \
87101
&& rm redis-*.tgz \
@@ -92,7 +106,7 @@ RUN pecl download redis \
92106
&& make install \
93107
&& cd ..
94108

95-
## Imagick
109+
# Imagick <https://github.com/Imagick/imagick>
96110
RUN pecl download imagick \
97111
&& tar xzf imagick-*.tgz \
98112
&& rm imagick-*.tgz \
@@ -114,13 +128,6 @@ RUN echo "" \
114128
&& echo "extension=imagick.so" > $PHP_INI_DIR/conf.d/docker-php-ext-imagick.ini \
115129
&& echo ""
116130

117-
## create symlinks
118-
#RUN ls -lah ${PHP_PREFIX}/lib/php/extensions/no-debug-non-zts-20240924/ \
119-
# && mkdir -p /usr/local/lib/php \
120-
# && ln -s $(php -r "echo ini_get('extension_dir');") /usr/local/lib/php/extensions \
121-
# && ls -lah $PHP_INI_DIR/conf.d/ \
122-
# && ln -s $PHP_INI_DIR/conf.d /usr/local/lib/php/conf.d
123-
124131
# =========================
125132
# Stage 2: Package extractor
126133
# =========================
@@ -170,7 +177,8 @@ RUN find /dpkg -mindepth 1 \
170177
! -path '/dpkg/usr' \
171178
! -path '/dpkg/usr/lib' \
172179
! -path '/dpkg/usr/lib/*' \
173-
-exec rm -rf {} +
180+
-exec rm -rf {} + \
181+
&& find /dpkg -type f \( -name '*.a' -o -name '*.la' \) -exec rm -f {} +
174182

175183
# List directory and file structure
176184
RUN tree /dpkg
@@ -193,6 +201,6 @@ LABEL org.opencontainers.image.authors="Tobias Hargesheimer <docker@ison.ws>" \
193201
org.opencontainers.image.source="https://github.com/Tob1as/docker-php"
194202
# Copy php extensions
195203
COPY --from=builder ${PHP_PREFIX}/lib/php/extensions/ ${PHP_PREFIX}/lib/php/extensions/
196-
COPY --from=builder ${PHP_PREFIX}/etc/php/conf.d/docker-php-ext-* ${PHP_PREFIX}/etc/php/conf.d/
204+
COPY --from=builder ${PHP_PREFIX}/etc/php/conf.d/ ${PHP_PREFIX}/etc/php/conf.d/
197205
# Copy the libraries from the extractor stage into root
198206
COPY --from=deb-extractor /dpkg /

examples/fpm-nginx-dhi/config/nginx_default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set_real_ip_from 172.16.0.0/12;
33
set_real_ip_from fd00::/8;
44
real_ip_header X-Forwarded-For;
5+
#real_ip_recursive on;
56

67
# Server (http)
78
server {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[www]
2+
access.format = "%R - %u %t \"%m %r%Q%q\" %s"

examples/fpm-nginx-dhi/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
volumes:
1212
- ./html:/var/www/html:rw
1313
- ./config/php_wsc.ini:/opt/php/etc/php/conf.d/60-wsc.ini:ro
14+
- ./config/php_fpm_settings.conf:/opt/php/etc/php-fpm.d/y-settings.conf:ro
1415
- ./config/php_fpm_status.conf:/opt/php/etc/php-fpm.d/y-status.conf:ro
1516
#depends_on:
1617
# wsc-db:

0 commit comments

Comments
 (0)