Skip to content

Commit

Permalink
Merge pull request #71 from vladbndko/php82
Browse files Browse the repository at this point in the history
⚡ update to nginx 1.25.2, php 8.2 & composer 2.5.8
  • Loading branch information
colinwilson authored Sep 25, 2023
2 parents 7be1172 + 0bc9547 commit 8c9de38
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish PHP 8.1 image to Docker Hub
name: Publish PHP 8.2 image to Docker Hub
on:
push:
jobs:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [0.7.4] - 24-09-2023
### Update
- nginx version 1.25.2 - [http://nginx.org/en/CHANGES](http://nginx.org/en/CHANGES)
- php version 8.2.9 - [https://secure.php.net/ChangeLog-8.php](https://secure.php.net/ChangeLog-8.php)
- composer version 2.5.8 [https://getcomposer.org/download/](https://getcomposer.org/download/)
- README update
- index.php update

## [0.7.3] - 11-03-2022
### Update
- build from debian:bullseye-slim image
Expand Down
62 changes: 31 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ LABEL maintainer="Colin Wilson colin@wyveo.com"

# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
ENV NGINX_VERSION 1.21.6-1~bullseye
ENV php_conf /etc/php/8.1/fpm/php.ini
ENV fpm_conf /etc/php/8.1/fpm/pool.d/www.conf
ENV COMPOSER_VERSION 2.2.7
ENV NGINX_VERSION 1.25.2-1~bullseye
ENV php_conf /etc/php/8.2/fpm/php.ini
ENV fpm_conf /etc/php/8.2/fpm/pool.d/www.conf
ENV COMPOSER_VERSION 2.5.8

# Install Basic Requirements
RUN buildDeps='curl gcc make autoconf libc-dev zlib1g-dev pkg-config' \
Expand Down Expand Up @@ -43,24 +43,24 @@ RUN buildDeps='curl gcc make autoconf libc-dev zlib1g-dev pkg-config' \
libmemcached11 \
libmagickwand-dev \
nginx=${NGINX_VERSION} \
php8.1-fpm \
php8.1-cli \
php8.1-bcmath \
php8.1-dev \
php8.1-common \
php8.1-opcache \
php8.1-readline \
php8.1-mbstring \
php8.1-curl \
php8.1-gd \
php8.1-imagick \
php8.1-mysql \
php8.1-zip \
php8.1-pgsql \
php8.1-intl \
php8.1-xml \
php8.2-fpm \
php8.2-cli \
php8.2-bcmath \
php8.2-dev \
php8.2-common \
php8.2-opcache \
php8.2-readline \
php8.2-mbstring \
php8.2-curl \
php8.2-gd \
php8.2-imagick \
php8.2-mysql \
php8.2-zip \
php8.2-pgsql \
php8.2-intl \
php8.2-xml \
php-pear \
&& pecl -d php_suffix=8.1 install -o -f redis memcached \
&& pecl -d php_suffix=8.2 install -o -f redis memcached \
&& mkdir -p /run/php \
&& pip install wheel \
&& pip install supervisor \
Expand All @@ -72,7 +72,7 @@ RUN buildDeps='curl gcc make autoconf libc-dev zlib1g-dev pkg-config' \
&& sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" ${php_conf} \
&& sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" ${php_conf} \
&& sed -i -e "s/variables_order = \"GPCS\"/variables_order = \"EGPCS\"/g" ${php_conf} \
&& sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php/8.1/fpm/php-fpm.conf \
&& sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php/8.2/fpm/php-fpm.conf \
&& sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" ${fpm_conf} \
&& sed -i -e "s/pm.max_children = 5/pm.max_children = 4/g" ${fpm_conf} \
&& sed -i -e "s/pm.start_servers = 2/pm.start_servers = 3/g" ${fpm_conf} \
Expand All @@ -81,15 +81,15 @@ RUN buildDeps='curl gcc make autoconf libc-dev zlib1g-dev pkg-config' \
&& sed -i -e "s/pm.max_requests = 500/pm.max_requests = 200/g" ${fpm_conf} \
&& sed -i -e "s/www-data/nginx/g" ${fpm_conf} \
&& sed -i -e "s/^;clear_env = no$/clear_env = no/" ${fpm_conf} \
&& echo "extension=redis.so" > /etc/php/8.1/mods-available/redis.ini \
&& echo "extension=memcached.so" > /etc/php/8.1/mods-available/memcached.ini \
&& echo "extension=imagick.so" > /etc/php/8.1/mods-available/imagick.ini \
&& ln -sf /etc/php/8.1/mods-available/redis.ini /etc/php/8.1/fpm/conf.d/20-redis.ini \
&& ln -sf /etc/php/8.1/mods-available/redis.ini /etc/php/8.1/cli/conf.d/20-redis.ini \
&& ln -sf /etc/php/8.1/mods-available/memcached.ini /etc/php/8.1/fpm/conf.d/20-memcached.ini \
&& ln -sf /etc/php/8.1/mods-available/memcached.ini /etc/php/8.1/cli/conf.d/20-memcached.ini \
&& ln -sf /etc/php/8.1/mods-available/imagick.ini /etc/php/8.1/fpm/conf.d/20-imagick.ini \
&& ln -sf /etc/php/8.1/mods-available/imagick.ini /etc/php/8.1/cli/conf.d/20-imagick.ini \
&& echo "extension=redis.so" > /etc/php/8.2/mods-available/redis.ini \
&& echo "extension=memcached.so" > /etc/php/8.2/mods-available/memcached.ini \
&& echo "extension=imagick.so" > /etc/php/8.2/mods-available/imagick.ini \
&& ln -sf /etc/php/8.2/mods-available/redis.ini /etc/php/8.2/fpm/conf.d/20-redis.ini \
&& ln -sf /etc/php/8.2/mods-available/redis.ini /etc/php/8.2/cli/conf.d/20-redis.ini \
&& ln -sf /etc/php/8.2/mods-available/memcached.ini /etc/php/8.2/fpm/conf.d/20-memcached.ini \
&& ln -sf /etc/php/8.2/mods-available/memcached.ini /etc/php/8.2/cli/conf.d/20-memcached.ini \
&& ln -sf /etc/php/8.2/mods-available/imagick.ini /etc/php/8.2/fpm/conf.d/20-imagick.ini \
&& ln -sf /etc/php/8.2/mods-available/imagick.ini /etc/php/8.2/cli/conf.d/20-imagick.ini \
# Install Composer
&& curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[![Docker Hub; wyveo/nginx-php-fpm](https://img.shields.io/badge/docker%20hub-wyveo%2Fnginx--php--fpm-blue.svg?&logo=docker&style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://badges.weareopensource.me/docker/pulls/wyveo/nginx-php-fpm?style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://img.shields.io/docker/image-size/wyveo/nginx-php-fpm/latest?style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![nginx 1.21.6](https://img.shields.io/badge/nginx-1.21.6-brightgreen.svg?&logo=nginx&logoColor=white&style=for-the-badge)](https://nginx.org/en/CHANGES) [![php 8.1.3](https://img.shields.io/badge/php--fpm-8.1.3-blue.svg?&logo=php&logoColor=white&style=for-the-badge)](https://secure.php.net/releases/8_1_3.php) [![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?&style=for-the-badge)](https://github.com/wyveo/nginx-php-fpm/blob/master/LICENSE)
[![Docker Hub; wyveo/nginx-php-fpm](https://img.shields.io/badge/docker%20hub-wyveo%2Fnginx--php--fpm-blue.svg?&logo=docker&style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://badges.weareopensource.me/docker/pulls/wyveo/nginx-php-fpm?style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![](https://img.shields.io/docker/image-size/wyveo/nginx-php-fpm/latest?style=for-the-badge)](https://hub.docker.com/r/wyveo/nginx-php-fpm/) [![nginx 1.25.2](https://img.shields.io/badge/nginx-1.25.2-brightgreen.svg?&logo=nginx&logoColor=white&style=for-the-badge)](https://nginx.org/en/CHANGES) [![php 8.2.9](https://img.shields.io/badge/php--fpm-8.2.9-blue.svg?&logo=php&logoColor=white&style=for-the-badge)](https://secure.php.net/releases/8_2_9.php) [![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?&style=for-the-badge)](https://github.com/wyveo/nginx-php-fpm/blob/master/LICENSE)

## Introduction
This is a Dockerfile to build a debian based container image running nginx and php-fpm 8.1.x / 8.0.x / 7.4.x / 7.3.x / 7.2.x / 7.1.x / 7.0.x & Composer.
This is a Dockerfile to build a debian based container image running nginx and php-fpm 8.2.x / 8.1.x / 8.0.x / 7.4.x / 7.3.x / 7.2.x / 7.1.x / 7.0.x & Composer.

### Versioning
| Docker Tag | GitHub Release | Nginx Version | PHP Version | Debian Version | Composer
|-----|-------|-----|--------|--------|------|
| latest | master Branch |1.21.6 | 8.1.3 | bullseye | 2.2.7 |
| php81 | php81 Branch |1.21.6 | 8.1.3 | bullseye | 2.2.7 |
| php80 | php80 Branch |1.21.6 | 8.0.16 | buster | 2.0.13 |
| php74 | php74 Branch |1.21.6 | 7.4.28 | buster | 2.0.13 |
| php73 | php73 Branch |1.21.6 | 7.3.33 | buster | 2.0.13 |
| php72 | php72 Branch |1.21.6 | 7.2.34 | buster | 2.0.13 |
| php71 | php71 Branch |1.21.6 | 7.1.33 | buster | 2.0.13 |
| php70 | php70 Branch |1.21.6 | 7.0.33 | buster | 2.0.13 |
| Docker Tag | GitHub Release | Nginx Version | PHP Version | Debian Version | Composer
|------------|----------------|---------------|-------------|----------------|----------|
| latest | master Branch | 1.25.2 | 8.2.9 | bullseye | 2.5.8 |
| php82 | php82 Branch | 1.25.2 | 8.2.9 | bullseye | 2.5.8 |
| php81 | php81 Branch | 1.21.6 | 8.1.3 | bullseye | 2.2.7 |
| php80 | php80 Branch | 1.21.6 | 8.0.16 | buster | 2.0.13 |
| php74 | php74 Branch | 1.21.6 | 7.4.28 | buster | 2.0.13 |
| php73 | php73 Branch | 1.21.6 | 7.3.33 | buster | 2.0.13 |
| php72 | php72 Branch | 1.21.6 | 7.2.34 | buster | 2.0.13 |
| php71 | php71 Branch | 1.21.6 | 7.1.33 | buster | 2.0.13 |
| php70 | php70 Branch | 1.21.6 | 7.0.33 | buster | 2.0.13 |

## Building from source
To build from source you need to clone the git repo and run docker build:
Expand All @@ -24,19 +25,19 @@ $ cd nginx-php-fpm

followed by
```
$ docker build -t nginx-php-fpm:php81 . # PHP 8.1.x
$ docker build -t nginx-php-fpm:php82 . # PHP 8.2.x
```


## Pulling from Docker Hub
```
$ docker pull wyveo/nginx-php-fpm:php81
$ docker pull wyveo/nginx-php-fpm:php82
```

## Running
To run the container:
```
$ sudo docker run -d wyveo/nginx-php-fpm:php81
$ sudo docker run -d wyveo/nginx-php-fpm:php82
```

Default web root:
Expand Down
2 changes: 1 addition & 1 deletion default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ server {
location ~ \.php$ {
try_files $uri $uri/ /index.php?$query_string;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Expand Down
2 changes: 1 addition & 1 deletion html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="one-half column" style="margin-top: 25%">
<img height="45px" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDYyOS4yMiA2OTkuNSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTM0OS4yNSAxOS43NWMtMTkuMDUtMTEtNTAuMjMtMTEtNjkuMjggMGwtMjMzLjgzIDEzNWMtMTkgMTEtMzQuNjQgMzgtMzQuNjQgNjB2MjcwYzAgMjIgMTUuNTkgNDkgMzQuNjQgNjBsMjMzLjg2IDEzNWMxOSAxMSA1MC4yMyAxMSA2OS4yOCAwbDIzMy44My0xMzVjMTktMTEgMzQuNjQtMzggMzQuNjQtNjB2LTI3MGMwLTIyLTE1LjU5LTQ5LTM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OSAxNDEuNjYtMi4yOSAxOC4yNy0xMy4wNiAyMy41LTI4LjA3IDIzLjVoLTQyLjA3Yy0yNC40OCAwLTI4LjcyLTE5LjU5LTMyLjMxLTMzLTMuOTItMTYuODUtMjguMzgtMTMxLjA5LTMyLjk3LTE1NC45MnoiLz48L3N2Zz4=">
<h4>Congratulations!</h4>
<p>You have successfully deployed a <strong>docker</strong> container running our <strong>NGINX</strong> with <strong>PHP-FPM 8.1.x</strong> image</p>
<p>You have successfully deployed a <strong>docker</strong> container running our <strong>NGINX</strong> with <strong>PHP-FPM 8.2.x</strong> image</p>
<p><strong>NGINX: </strong>v<?php echo $_ENV['NGINX_VERSION'] ?><br><strong>PHP-FPM: </strong>v<?php echo phpversion(); ?><br><strong>LOADED CONFIG: </strong><?php echo php_ini_loaded_file(); ?><br><strong>WEB ROOT: </strong><?php echo $_ENV['DOCUMENT_ROOT'] ?><br><strong>HOSTNAME: </strong><?php echo gethostname(); ?><br></p>
<em>Thank you for using <a style="text-decoration:none" href="https://wyveo.com" target="_blank">wyveo.com</a></em>
</div>
Expand Down
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket

[program:php-fpm8]
command=/usr/sbin/php-fpm8.1 --nodaemonize --fpm-config=/etc/php/8.1/fpm/pool.d/www.conf
command=/usr/sbin/php-fpm8.2 --nodaemonize --fpm-config=/etc/php/8.2/fpm/pool.d/www.conf
autostart=true
autorestart=true
priority=5
Expand Down

0 comments on commit 8c9de38

Please sign in to comment.