Skip to content

Commit 6afa72b

Browse files
committed
Update
1 parent 34bd34e commit 6afa72b

File tree

8 files changed

+387
-4
lines changed

8 files changed

+387
-4
lines changed

.github/workflows/php83.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: php-fpm 8.3
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Login to DockerHub
17+
uses: docker/login-action@v1
18+
with:
19+
username: ${{ secrets.DOCKER_HUB_USER }}
20+
password: ${{ secrets.DOCKER_HUB_PWD }}
21+
-
22+
name: Build and push php8.3
23+
uses: docker/build-push-action@v2
24+
with:
25+
context: ./8.3
26+
push: true
27+
tags: shion/php-fpm:8.3
28+
-
29+
name: Build and push php8.3
30+
uses: docker/build-push-action@v2
31+
with:
32+
context: ./8.3
33+
push: true
34+
tags: shion/php-fpm:latest

.github/workflows/php84.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: php-fpm 8.4
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Login to DockerHub
17+
uses: docker/login-action@v1
18+
with:
19+
username: ${{ secrets.DOCKER_HUB_USER }}
20+
password: ${{ secrets.DOCKER_HUB_PWD }}
21+
-
22+
name: Build and push php8.4
23+
uses: docker/build-push-action@v2
24+
with:
25+
context: ./8.4
26+
push: true
27+
tags: shion/php-fpm:8.4
28+
-
29+
name: Build and push php8.4
30+
uses: docker/build-push-action@v2
31+
with:
32+
context: ./8.4
33+
push: true
34+
tags: shion/php-fpm:latest

8.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:3.16
22
LABEL maintainer="Shion <shion.chow@gmail.com>"
33

4-
ENV PHP_VERSION 8.0.29
4+
ENV PHP_VERSION 8.0.30
55

66
ENV BUILD_TOOLS \
77
pkgconf \

8.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:3.18
22
LABEL maintainer="Shion <shion.chow@gmail.com>"
33

4-
ENV PHP_VERSION 8.1.21
4+
ENV PHP_VERSION 8.1.31
55

66
ENV BUILD_TOOLS \
77
pkgconf \

8.2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:3.18
22
LABEL maintainer="Shion <shion.chow@gmail.com>"
33

4-
ENV PHP_VERSION 8.2.8
4+
ENV PHP_VERSION 8.2.27
55

66
ENV BUILD_TOOLS \
77
pkgconf \

8.3/Dockerfile

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
FROM alpine:3.18
2+
LABEL maintainer="Shion <shion.chow@gmail.com>"
3+
4+
ENV PHP_VERSION 8.3.17
5+
6+
ENV BUILD_TOOLS \
7+
pkgconf \
8+
curl \
9+
autoconf \
10+
make \
11+
gcc \
12+
libc-dev
13+
14+
ENV BUILD_DEPS \
15+
libxml2-dev \
16+
curl-dev \
17+
sqlite-dev \
18+
gd-dev \
19+
gettext-dev \
20+
gmp-dev \
21+
oniguruma-dev \
22+
postgresql-dev \
23+
libedit-dev \
24+
libzip-dev \
25+
libxpm-dev \
26+
libmemcached-dev \
27+
imagemagick-dev
28+
29+
ENV RUNTIME_DEPS \
30+
libpq \
31+
gmp \
32+
libintl \
33+
libxml2 \
34+
sqlite-libs \
35+
libcurl \
36+
libpng \
37+
libwebp \
38+
libjpeg-turbo \
39+
libxpm \
40+
freetype \
41+
oniguruma \
42+
libedit \
43+
libedit \
44+
libzip \
45+
libmemcached \
46+
icu-libs \
47+
imagemagick
48+
49+
ENV PHP_INI_DIR /usr/local/etc/php
50+
51+
# 82 is the standard uid/gid for "www-data" in Alpine
52+
RUN adduser -u 82 -D -H -S -G www-data www-data
53+
54+
# https://github.com/docker-library/php/issues/272
55+
RUN export CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
56+
&& export CPPFLAGS=${CFLAGS} \
57+
&& export LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
58+
&& export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
59+
60+
RUN apk add --no-cache --virtual .build-tools $BUILD_TOOLS \
61+
&& apk add --no-cache --virtual .build-deps $BUILD_DEPS \
62+
&& apk add --no-cache --virtual .runtime-deps $RUNTIME_DEPS \
63+
&& mkdir -p $PHP_INI_DIR/conf.d \
64+
&& mkdir -p /usr/src \
65+
&& cd /usr/src \
66+
&& curl -o php.tar.gz -L https://www.php.net/distributions/php-${PHP_VERSION}.tar.gz \
67+
&& tar -zxf php.tar.gz \
68+
&& cd php-${PHP_VERSION} \
69+
&& ./configure \
70+
--with-config-file-path=$PHP_INI_DIR \
71+
--with-config-file-scan-dir=$PHP_INI_DIR/conf.d \
72+
--enable-fpm \
73+
--with-fpm-user=www-data \
74+
--with-fpm-group=www-data \
75+
--disable-cgi \
76+
--disable-short-tags \
77+
--with-openssl \
78+
--with-pcre-jit \
79+
--with-zlib \
80+
--enable-bcmath \
81+
--with-curl \
82+
--enable-exif \
83+
--enable-gd \
84+
--with-webp \
85+
--with-jpeg \
86+
--with-xpm \
87+
--with-freetype \
88+
--with-gettext \
89+
--with-gmp \
90+
--enable-mbstring \
91+
--with-pdo-mysql \
92+
--with-pdo-pgsql \
93+
--with-libedit \
94+
--with-zip \
95+
--enable-mysqlnd \
96+
&& make \
97+
&& make install \
98+
# config
99+
&& cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf \
100+
&& cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf \
101+
&& sed -i 's/;error_log = log\/php-fpm.log/error_log = \/proc\/self\/fd\/2/g' /usr/local/etc/php-fpm.conf \
102+
&& sed -i 's/;daemonize = yes/daemonize = no/g' /usr/local/etc/php-fpm.conf \
103+
&& sed -i 's!=NONE/!=!g' /usr/local/etc/php-fpm.conf \
104+
&& sed -i 's/listen = 127.0.0.1:9000/listen = [::]:9000/g' /usr/local/etc/php-fpm.d/www.conf \
105+
&& sed -i 's/;access.log = log\/\$pool.access.log/access.log = \/proc\/self\/fd\/2/g' /usr/local/etc/php-fpm.d/www.conf \
106+
&& sed -i 's/;catch_workers_output = yes/catch_workers_output = yes/g' /usr/local/etc/php-fpm.d/www.conf \
107+
&& sed -i 's/;clear_env = no/clear_env = yes/g' /usr/local/etc/php-fpm.d/www.conf \
108+
&& echo "zend_extension=opcache.so" >> $PHP_INI_DIR/conf.d/opcache.ini \
109+
# memcached
110+
&& cd /usr/src \
111+
&& curl -o memcached.tar.gz -L https://pecl.php.net/get/memcached \
112+
&& tar -zxvf memcached.tar.gz \
113+
&& cd memcached-* \
114+
&& phpize \
115+
&& ./configure --enable-memcached-json --disable-memcached-sasl \
116+
&& make \
117+
&& make install \
118+
&& echo "extension=memcached.so" >> $PHP_INI_DIR/conf.d/memcached.ini \
119+
# redis
120+
&& cd /usr/src \
121+
&& curl -o redis.tar.gz -L https://pecl.php.net/get/redis \
122+
&& tar -zxvf redis.tar.gz \
123+
&& cd redis-* \
124+
&& phpize \
125+
&& ./configure \
126+
&& make \
127+
&& make install \
128+
&& echo "extension=redis.so" >> $PHP_INI_DIR/conf.d/redis.ini \
129+
# mongodb
130+
&& cd /usr/src \
131+
&& curl -o mongodb.tar.gz -L https://pecl.php.net/get/mongodb \
132+
&& tar -zxvf mongodb.tar.gz \
133+
&& cd mongodb-* \
134+
&& phpize \
135+
&& ./configure \
136+
&& make \
137+
&& make install \
138+
&& echo "extension=mongodb.so" >> $PHP_INI_DIR/conf.d/mongodb.ini \
139+
# imagick
140+
&& cd /usr/src \
141+
&& curl -o imagick.tar.gz -L https://pecl.php.net/get/imagick \
142+
&& tar -zxvf imagick.tar.gz \
143+
&& cd imagick-* \
144+
&& phpize \
145+
&& ./configure \
146+
&& make \
147+
&& make install \
148+
&& echo "extension=imagick.so" >> $PHP_INI_DIR/conf.d/imagick.ini \
149+
# clear
150+
&& cd ~ && rm -rf /usr/src && apk del .build-tools .build-deps
151+
152+
VOLUME ["/app"]
153+
WORKDIR /app
154+
155+
EXPOSE 9000
156+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)