Skip to content

Commit

Permalink
Add PHP 8.4 support (#497)
Browse files Browse the repository at this point in the history
* add configuration for php 8.4 support

* Changed a few spots to 8.4 and added placeholders

* Added PHP 8.4 docker hub badges

* Updated other examples to have 8.4

---------

Co-authored-by: Jay Rogers <[email protected]>
  • Loading branch information
tomschlick and jaydrogers authored Nov 22, 2024
1 parent fc51ff5 commit 900736a
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 57 deletions.
16 changes: 8 additions & 8 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/content/docs/2.getting-started/2.installation.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Or you can simply use Docker's port mapping feature to map the container port to
label: Run FPM NGINX on port 80 and 443
---
```bash
docker run -p 80:8080 -p 443:8443 serversideup/php:8.3-fpm-nginx
docker run -p 80:8080 -p 443:8443 serversideup/php:8.4-fpm-nginx
```
::

Expand Down
12 changes: 6 additions & 6 deletions docs/content/docs/2.getting-started/3.upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ If you do not select a specific patch version, then you will receive automatic P

For example, you can select your version based on the different version numbers:
- Major Version (example: `8` will give you the latest 8.x version)
- Minor Version (example: `8.3` will give you the latest 8.3.x version)
- Patch Version (example: `8.3.2` will always stay at the 8.3.2 version)
- Minor Version (example: `8.4` will give you the latest 8.4.x version)
- Patch Version (example: `8.4.1` will always stay at the 8.4.1 version)

If you use `latest`, you will always get the latest stable version of the CLI variation of PHP. For the best stability in production environments, you may want to pin to a specific patch version (example: `8.3.2`).
If you use `latest`, you will always get the latest stable version of the CLI variation of PHP. For the best stability in production environments, you may want to pin to a specific patch version (example: `8.4.1`).

## Release process
All source code is merged into the `main` branch, which automatically build our "beta" images.
Expand All @@ -29,7 +29,7 @@ Any updates that you apply have a risk of breaking other things inside the conta
label: Example Dockerfile with manual updates for Debian
---
```dockerfile
FROM serversideup/php:8.3.2-fpm-nginx
FROM serversideup/php:8.4.1-fpm-nginx

RUN apt-get update \
&& apt-get upgrade -y \
Expand All @@ -45,7 +45,7 @@ If you're running an Alpine-based image, you can use the following commands:
label: Example Dockerfile with manual updates for Alpine
---
```dockerfile
FROM serversideup/php:8.3.2-fpm-nginx-alpine
FROM serversideup/php:8.4.1-fpm-nginx-alpine

RUN apk update \
&& apk upgrade \
Expand All @@ -56,4 +56,4 @@ RUN apk update \
## Subscribe to repository updates
Regardless if you are choosing to use automatic updates or manual updates, it is highly advised to subscribe to our releases. You can do this through the "Watch" button on our [GitHub](https://github.com/serversideup/docker-php).

![Watch Repository](/images/docs/watch-repo.png)
![Watch Repository](/images/docs/watch-repo.png)
22 changes: 11 additions & 11 deletions docs/content/docs/2.getting-started/7.contributing.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: docs
## Changing the base image
We follow the same naming convention as the official PHP images, so you can easily switch to our images by changing the base image in your `Dockerfile` or `docker-compose.yml` file.

For example: If you're running `php:8.3-cli-alpine`, you can simply change it to `serversideup/php:8.3-cli-alpine` and you're ready to go. It's that easy!
For example: If you're running `php:8.4-cli-alpine`, you can simply change it to `serversideup/php:8.4-cli-alpine` and you're ready to go. It's that easy!

## Before making the change
We encourage you to get familiar with our [default configurations](/docs/getting-started/default-configurations) and [environment variable specifications](/docs/reference/environment-variable-specification) before making the switch. We've improved the developer experience in a number of ways, so be sure you're evaluating how certain customizations are provided by default and that you're not duplicating conflicting customizations.
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/3.guide/100.migrating-from-v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ All you need to do is add `-v2.2.1` to the end of the image tag. This will ensur
We've been busy overhauling our PHP Docker Images to make them more production-ready and easier to use. Here are some of the new features we've added:
- **Based on official PHP Images** - We're now building an improved developer experience on top of the official PHP Docker images.
- **Unprivileged by default** - We're now running our images as an unprivileged user by default. This is a huge step forward in security and compatibility.
- **PHP 8.3 support** - We're now shipping the latest and greatest.
- **PHP 8.4 support** - We're now shipping the latest and greatest.
- **Pin to the exact minor version** - Pin your app to the exact minor version of PHP that you want to use. This means you can pin to `8.2.12` instead of `8.2`.
- **Easier start up script customization** - We now have a folder called `/etc/entrypoint.d` that allows you to easily customize your container with scripts. Just put them in numerical order and we'll execute any shell script you want. No S6 Overlay knowledge required.
- **Expanded Laravel Automations** - We added automations to run `config:cache`, `route:cache`, `view:cache`, `event:cache`, `migrate --force --isolated`, and `storage:link`
Expand Down Expand Up @@ -131,7 +131,7 @@ label: Dockerfile
# Learn more about the Server Side Up PHP Docker Images at:
# https://serversideup.net/open-source/docker-php/
FROM serversideup/php:8.3-fpm-nginx AS base
FROM serversideup/php:8.4-fpm-nginx AS base
## Uncomment if you need to install additional PHP extensions
# USER root
Expand Down Expand Up @@ -181,4 +181,4 @@ USER www-data

#### Deployment
- CI/CD with valid tests is always encouraged
- After completing all steps above, you're now ready to deploy the new images
- After completing all steps above, you're now ready to deploy the new images
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ label: Dockerfile
############################################
# Base Image
############################################
FROM serversideup/php:8.3-fpm-nginx-bookworm AS base
FROM serversideup/php:8.4-fpm-nginx-bookworm AS base

############################################
# Development Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Then in our Dockerfile, we can copy this file to the `/usr/local/etc/php/conf.d/
label: "Dockerfile: Append to our default configuration"
---
```dockerfile
FROM serversideup/php:8.3-fpm-nginx-bookworm
FROM serversideup/php:8.4-fpm-nginx-bookworm

COPY zzz-custom-php.ini /usr/local/etc/php/conf.d/
```
Expand All @@ -82,7 +82,7 @@ If you prefer to remove the default `php.ini` file, you can do so by adding the
label: "Dockerfile: Remove our default configuration"
---
```dockerfile
FROM serversideup/php:8.3-fpm-nginx-bookworm
FROM serversideup/php:8.4-fpm-nginx-bookworm

RUN rm /usr/local/etc/php/conf.d/serversideup-docker-php.ini
COPY zzz-custom-php.ini /usr/local/etc/php/conf.d/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ label: Dockerfile

# Learn more about the Server Side Up PHP Docker Images at:
# https://serversideup.net/open-source/docker-php/
FROM serversideup/php:8.3-fpm-nginx AS base
FROM serversideup/php:8.4-fpm-nginx AS base

# Switch to root before installing our PHP extensions
USER root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Now, let's take a look at our `Dockerfile`:
label: "Dockerfile"
---
```dockerfile
FROM serversideup/php:8.3-unit
FROM serversideup/php:8.4-unit

COPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/
```
Expand All @@ -90,7 +90,6 @@ Finally, let's take a look at our `docker-compose.yml` file:
label: "docker-compose.yml"
---
```yaml
version: '3'
services:
php:
build:
Expand Down Expand Up @@ -128,7 +127,7 @@ example-project |
example-project | 👋 Hello, world!
example-project | 2023/12/05 19:52:38 [info] 1#1 unit 1.31.1 started
example-project | 2023/12/05 19:52:38 [info] 65#65 discovery started
example-project | 2023/12/05 19:52:38 [notice] 65#65 module: php 8.3.0 "/usr/lib/unit/modules/php.unit.so"
example-project | 2023/12/05 19:52:38 [notice] 65#65 module: php 8.4.0 "/usr/lib/unit/modules/php.unit.so"
example-project | 2023/12/05 19:52:38 [info] 1#1 controller started
example-project | 2023/12/05 19:52:38 [notice] 1#1 process 65 exited with code 0
example-project | 2023/12/05 19:52:38 [info] 67#67 router started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ If you set `SSL_MODE` to `mixed` or `full`, a self-signed certificate will be ge
label: Set SSL mode to "mixed" (HTTP + HTTPS)
---
```yaml
version: '3'
services:
php:
image: serversideup/php:8.3-fpm-nginx
image: serversideup/php:8.4-fpm-nginx
ports:
- 80:8080
- 443:8443
Expand All @@ -43,10 +42,9 @@ In order to add your own certificate, you will need to mount the certificate fil
label: Providing your own certificate pair
---
```yaml
version: '3'
services:
php:
image: serversideup/php:8.3-fpm-nginx
image: serversideup/php:8.4-fpm-nginx
ports:
- 80:8080
- 443:8443
Expand Down
11 changes: 9 additions & 2 deletions scripts/conf/php-versions-base-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ php_versions:
- name: bookworm
default: true
patch_versions:
# - 8.3.6 # Pull latest from Official PHP source
# - 8.3.6 # Pull latest from Official PHP source
- minor: "8.4"
base_os:
- name: alpine
- name: bookworm
default: true
patch_versions:
# - 8.4.1 # Pull latest from Official PHP source
php_variations:
- name: cli
default: true
Expand All @@ -50,4 +57,4 @@ php_variations:
- name: unit
supported_os: # Alpine with Unit is not supported yet. Submit a PR if you can help (https://github.com/serversideup/docker-php/issues/233)
- bullseye
- bookworm
- bookworm
2 changes: 1 addition & 1 deletion src/variations/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_OS_VERSION='bookworm'
ARG PHP_VERSION='8.3'
ARG PHP_VERSION='8.4'
ARG PHP_VARIATION='cli'

##########
Expand Down
4 changes: 2 additions & 2 deletions src/variations/fpm-apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_OS_VERSION='bookworm'
ARG PHP_VERSION='8.3'
ARG PHP_VERSION='8.4'
ARG PHP_VARIATION='fpm-apache'
ARG BASE_IMAGE="php:${PHP_VERSION}-fpm-${BASE_OS_VERSION}"

Expand Down Expand Up @@ -162,4 +162,4 @@ WORKDIR ${APP_BASE_DIR}
CMD ["/init"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]
4 changes: 2 additions & 2 deletions src/variations/fpm-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_OS_VERSION='bookworm'
ARG PHP_VERSION='8.3'
ARG PHP_VERSION='8.4'
ARG BASE_IMAGE="php:${PHP_VERSION}-fpm-${BASE_OS_VERSION}"

##########
Expand Down Expand Up @@ -190,4 +190,4 @@ WORKDIR ${APP_BASE_DIR}
CMD ["/init"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]
4 changes: 2 additions & 2 deletions src/variations/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_OS_VERSION='bookworm'
ARG PHP_VERSION='8.3'
ARG PHP_VERSION='8.4'
ARG PHP_VARIATION='fpm'

##########
Expand Down Expand Up @@ -103,4 +103,4 @@ USER www-data
CMD ["php-fpm"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD php-fpm-healthcheck || exit 1
CMD php-fpm-healthcheck || exit 1
4 changes: 2 additions & 2 deletions src/variations/unit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_OS_VERSION='bookworm'
ARG PHP_VERSION='8.3'
ARG PHP_VERSION='8.4'
ARG PHP_VARIATION='unit'
ARG BASE_IMAGE="php:${PHP_VERSION}-cli-${BASE_OS_VERSION}"

Expand Down Expand Up @@ -168,4 +168,4 @@ EXPOSE 8080 8443
CMD ["unitd", "--no-daemon"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]
CMD [ "sh", "-c", "curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH || exit 1" ]

0 comments on commit 900736a

Please sign in to comment.