Skip to content

Commit ae0a977

Browse files
authored
Add php 8.4 support (#209)
* feat: upgrade PHP version to 8.4 * fix: update install-php-extensions URL to version 2.7.34 in Dockerfiles * feat: add Docker Build Check workflow for automated image builds * fix: update base image version to unit:1.34.2-php8.4 in Dockerfile * feat: enhance Docker Build Check workflow with Composer installation and diagnostics * fix: ensure safe.directory is set for www-data user in Dockerfile * feat: add Composer public key downloads to Dockerfile for improved security * fix: update COMPOSER_HOME path and set user for Docker commands in build check workflow * refactor: remove installation and testing steps for development Dockerfile in build check workflow
1 parent 2258c78 commit ae0a977

File tree

7 files changed

+107
-39
lines changed

7 files changed

+107
-39
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Docker Build Check"
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'docker/**'
8+
- '.github/workflows/docker-build-check.yaml'
9+
pull_request:
10+
branches: [ main, master ]
11+
paths:
12+
- 'docker/**'
13+
- '.github/workflows/docker-build-check.yaml'
14+
workflow_dispatch: # Allows manual triggering
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build-check:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
dockerfile:
25+
- docker/php/Dockerfile
26+
- docker/php/package.Dockerfile
27+
steps:
28+
- name: Check out code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
with:
34+
platforms: arm64
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
with:
39+
platforms: linux/amd64,linux/arm64
40+
41+
- name: Build Docker image (no push)
42+
uses: docker/build-push-action@v5
43+
with:
44+
context: ${{ matrix.dockerfile == 'docker/php/Dockerfile' && './docker/php' || '.' }}
45+
file: ${{ matrix.dockerfile }}
46+
push: false
47+
platforms: linux/amd64
48+
tags: satisfy-test:${{ github.sha }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max
51+
load: true
52+
53+
- name: Run basic Composer diagnostics
54+
run: |
55+
docker run --rm \
56+
-v ${{ github.workspace }}:/var/www/html \
57+
-w /var/www/html \
58+
-e COMPOSER_HOME=/var/www/.composer \
59+
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
60+
--user www-data \
61+
satisfy-test:${{ github.sha }} \
62+
composer diagnose
63+
64+
- name: Check platform requirements
65+
run: |
66+
docker run --rm \
67+
-v ${{ github.workspace }}:/var/www/html \
68+
-w /var/www/html \
69+
-e COMPOSER_HOME=/var/www/.composer \
70+
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
71+
--user www-data \
72+
satisfy-test:${{ github.sha }} \
73+
composer check-platform-reqs

.github/workflows/docker-image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: "8.2"
21+
php-version: "8.4"
2222
extensions: mbstring
2323
coverage: none
2424

.github/workflows/phpunit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php: [8.2, 8.3]
11+
php: [8.2, 8.3, 8.4]
1212

1313
name: PHP ${{ matrix.php }}
1414

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"symfony/twig-bundle": "6.4.*",
4646
"symfony/validator": "6.4.*",
4747
"symfony/yaml": "6.4.*",
48-
"laminas/laminas-diactoros": "^2.3",
48+
"laminas/laminas-diactoros": "^3.6",
4949
"symfony/monolog-bundle": "^3.8",
5050
"symfony/dependency-injection": "6.4.*",
5151
"symfony/event-dispatcher": "6.4.*",

composer.lock

Lines changed: 21 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/php/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM unit:1.32.0-php8.2
1+
FROM unit:1.34.2-php8.4
22

33
RUN apt update && \
44
apt install -qy wget curl git zip unzip && \
55
apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
66

7-
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.2.5/install-php-extensions /usr/local/bin/
7+
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.7.34/install-php-extensions /usr/local/bin/
88
RUN install-php-extensions @composer zip
99

1010
RUN chown -R www-data:www-data /var/www
@@ -14,6 +14,8 @@ COPY php.ini /usr/local/etc/php/conf.d/satisfy.ini
1414
USER www-data
1515
RUN mkdir -p ~/.ssh && chmod 0700 ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts && \
1616
mkdir -p ~/.composer && chown www-data:www-data ~/.composer && \
17+
wget -O ~/.composer/keys.dev.pub https://composer.github.io/snapshots.pub && \
18+
wget -O ~/.composer/keys.tags.pub https://composer.github.io/releases.pub && \
1719
git config --global --add safe.directory /var/www/html
1820

1921
USER root

docker/php/package.Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
FROM unit:1.32.0-php8.2
1+
FROM unit:1.34.2-php8.4
22

33
RUN apt update && \
44
apt install -qy wget curl git zip unzip && \
55
apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
66

7-
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.2.5/install-php-extensions /usr/local/bin/
7+
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.7.34/install-php-extensions /usr/local/bin/
88
RUN install-php-extensions @composer zip
99

1010
COPY docker/php/unit.json /docker-entrypoint.d/config.json
1111
COPY docker/php/php.ini /usr/local/etc/php/conf.d/satisfy.ini
12-
RUN chown -R www-data:www-data /var/www
12+
RUN chown -R www-data:www-data /var/www && \
13+
git config --global --add safe.directory /var/www/html
1314

1415
USER www-data
1516
RUN mkdir -p ~/.ssh && chmod 0700 ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts && \
1617
mkdir -p ~/.composer && \
1718
wget -O ~/.composer/keys.dev.pub https://composer.github.io/snapshots.pub && \
18-
wget -O ~/.composer/keys.tags.pub https://composer.github.io/releases.pub
19+
wget -O ~/.composer/keys.tags.pub https://composer.github.io/releases.pub && \
20+
git config --global --add safe.directory /var/www/html
1921
VOLUME /var/www/.composer
2022

2123
ENV APP_PATH=/var/www/html

0 commit comments

Comments
 (0)