Skip to content

Commit 7368fe2

Browse files
authored
Merge pull request #4 from milejko/feature/automatic-templating
Feature/automatic templating
2 parents f104393 + 90ff3bc commit 7368fe2

File tree

12 files changed

+25
-34
lines changed

12 files changed

+25
-34
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
php-version: ['8.3', '8.2', '8.1', '8.0', '7.4']
2121
variant: ['fpm', 'cli']
22-
fail-fast: true
22+
fail-fast: false
2323
runs-on: ubuntu-latest
2424
steps:
2525
-

.github/workflows/test-image.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
docker run -e UPLOAD_MAX_FILESIZE=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "upload_max_filesize => 200M"
4+
docker run -e POST_MAX_SIZE=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "post_max_size => 200M"
5+
docker run -e OPCACHE_MEMORY_CONSUMPTION=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "opcache.memory_consumption => 200M"
6+
37
docker run ${IMAGE_TAG} -m | grep "bcmath"
48
docker run ${IMAGE_TAG} -m | grep "calendar"
59
docker run ${IMAGE_TAG} -m | grep "Core"
@@ -47,7 +51,4 @@ docker run ${IMAGE_TAG} -m | grep "zlib"
4751
docker run ${IMAGE_TAG} -a | grep "Interactive"
4852

4953
docker run ${IMAGE_TAG} composer -V | grep "Composer version"
50-
51-
docker run -e UPLOAD_MAX_FILESIZE=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "upload_max_filesize => 200M"
52-
docker run -e POST_MAX_SIZE=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "post_max_size => 200M"
53-
docker run -e OPCACHE_MEMORY_CONSUMPTION=200M ${IMAGE_TAG} -r 'phpinfo();' | grep "opcache.memory_consumption => 200M"
54+
docker run ${IMAGE_TAG} pwd | grep "/app"

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# syntax=docker/dockerfile:1.6
22

3-
ARG DEBIAN_VERSION=bookworm-slim
3+
ARG OS_VERSION=bookworm-slim
44

55
## PHP-CLI stage
6-
FROM debian:${DEBIAN_VERSION} as php-cli
6+
FROM debian:${OS_VERSION} as php-cli
77

88
ARG PHP_VERSION=8.2
99

@@ -24,7 +24,6 @@ ENV APP_DIR=/app \
2424

2525
RUN apt-get update && \
2626
apt-get install -yq --no-install-recommends \
27-
gettext-base \
2827
lsb-release \
2928
wget \
3029
ca-certificates \
@@ -50,7 +49,8 @@ RUN apt-get update && \
5049
# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163
5150
STOPSIGNAL SIGQUIT
5251

53-
COPY --link ./etc/php /etc/php
52+
COPY --link ./etc/php/cli /etc/php/${PHP_VERSION}/cli
53+
COPY --link ./etc/php/mods-available /etc/php/${PHP_VERSION}/mods-available
5454
COPY --link --chmod=755 ./docker-entrypoint.d /docker-entrypoint.d
5555
COPY --link --chmod=755 ./docker-entrypoint /docker-entrypoint
5656

@@ -77,6 +77,8 @@ RUN apt-get install -yq --no-install-recommends \
7777
php${PHP_VERSION}-fpm && \
7878
ln -s /usr/sbin/php-fpm${PHP_VERSION} /usr/bin/php-fpm
7979

80+
COPY --link ./etc/php/fpm /etc/php/${PHP_VERSION}/fpm
81+
8082
EXPOSE ${FPM_LISTEN_PORT}
8183

8284
CMD [ "/usr/bin/php-fpm" ]

README.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1>PHP Docker image, extendable with APT packages</h1>
22
<p>
33
Debian-slim based, open source, Docker image with ease of configuration in the heart.<br>
4-
Dockerfile can be found here: <a target="blank"
4+
The Dockerfile can be found here: <a target="blank"
55
href="https://github.com/milejko/php/blob/main/Dockerfile">https://github.com/milejko/php</a>.<br>
66
<br>
77
Supported versions: 7.4, 8.0, 8.1, 8.2, 8.3-RC<br>
@@ -12,6 +12,9 @@ <h2>Core features</h2>
1212
<li>
1313
A clean way of configuring: by passing ENVs during the runtime/orchestration (<a href="#env">ie. MEMORY_LIMIT, list below</a>)
1414
</li>
15+
<li>
16+
Easily customizable entrypoint - implemented "/docker-entrypoint.d/" directory
17+
</li>
1518
<li>
1619
PHP and <a href="#modules">default modules</a> are installed from <a target="_blank" href="https://deb.sury.org">DEB packages</a>
1720
</li>

docker-entrypoint.d/.placeholder

Whitespace-only changes.

docker-entrypoint.d/10-compile-fpm-pool-config

Lines changed: 0 additions & 5 deletions
This file was deleted.

docker-entrypoint.d/10-compile-opcache-config

Lines changed: 0 additions & 4 deletions
This file was deleted.

docker-entrypoint.d/10-compile-php-config

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[PHP]
2+
memory_limit = ${MEMORY_LIMIT}
3+
max_execution_time = ${MAX_EXECUTION_TIME}
4+
upload_max_filesize = ${UPLOAD_MAX_FILESIZE}
5+
post_max_size = ${POST_MAX_SIZE}

0 commit comments

Comments
 (0)