Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/php-84.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PHP 8.4

on:
workflow_dispatch:
push:
branches: [ main, php-8.4 ]
paths:
- 8.4/**
release:
types: [ published ]

jobs:
push_to_registry:
strategy:
matrix:
image:
- name: "[8.4][base]"
target: "base"
context: 8.4
tags: |
jopplt/php:8.4-fpm-base
platforms: linux/amd64,linux/arm64
- name: "[8.4][dev]"
target: "dev"
context: 8.4
tags: |
jopplt/php:8.4-fpm-dev
platforms: linux/amd64,linux/arm64
fail-fast: true
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "${{ matrix.image.name }}"
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ matrix.image.context }}
target: ${{ matrix.image.target }}
platforms: ${{ matrix.image.platforms }}
push: true
tags: ${{ matrix.image.tags }}
build-args: ${{ matrix.image.build-args }}
cache-from: type=gha
cache-to: type=gha,mode=max
8 changes: 0 additions & 8 deletions 8.3/config/newrelic.ini

This file was deleted.

55 changes: 55 additions & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM php:8.4.5-fpm-alpine3.21 AS base
WORKDIR /app
VOLUME /app
COPY config/php.ini /usr/local/etc/php/php.ini
RUN apk --update add --no-cache --virtual .build-deps \
build-base \
autoconf \
# Base packages
&& apk --update add --no-cache \
curl \
git \
bash \
supervisor \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev \
libzip-dev zip unzip \
oniguruma-dev \
libxml2-dev \
# Additional extensions
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
exif \
gd \
intl \
bcmath \
mbstring \
mysqli \
pdo \
pdo_mysql \
opcache \
pcntl \
zip \
&& pecl install -o -f redis \
&& docker-php-ext-enable \
redis \
# Cleanup
&& apk del .build-deps

FROM base AS dev
COPY config/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN apk --update add --no-cache --virtual .build-deps \
# Build dependencies
build-base \
gcc \
autoconf \
linux-headers \
&& apk --update add --no-cache \
# Dev packages
php83-pecl-xdebug \
sqlite \
mysql-client \
&& pecl install \
xdebug \
# Cleanup
&& apk del .build-deps
4 changes: 4 additions & 0 deletions 8.4/config/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
opcache.memory_consumption=256
opcache.max_accelerated_files = 20000
realpath_cache_size = 4096K
realpath_cache_ttl = 600
4 changes: 4 additions & 0 deletions 8.4/config/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,64 @@ PHP docker image for php/mysql developers.
Link to DockerHub: https://hub.docker.com/r/jopplt/php/tags

## Tags
### `8.3-fpm-base`: Base image for PHP development
### `8.4-fpm-base`: Base image for PHP development
```
docker pull jopplt/php:8.3-fpm-base
docker pull jopplt/php:8.4-fpm-base
```
Bundled with:
* Composer
* Node
* NPM

Includes the following extensions:
* `exif`
* `gd`
* `intl`
* `bcmath`
* `mbstring`
* `mysqli`
* `pdo`
* `pdo_mysql`
* `opcache`
* `pcntl`
* `zip`
* `redis`

Get a shell:
```
docker run --rm -it -v ${PWD}:/app jopplt/php:8.3-fpm-base sh
docker run --rm -it -v ${PWD}:/app jopplt/php:8.4-fpm-base sh
```

Custom `php.ini` configuration?:
```
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/php.ini:/usr/local/etc/php/php.ini jopplt/php:8.3-fpm-base sh
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/php.ini:/usr/local/etc/php/php.ini jopplt/php:8.4-fpm-base sh
```

### `8.3-fpm-dev`: Base image with additional tools for local development
### `8.4-fpm-dev`: Base image with additional tools for local development
```
docker pull jopplt/php:8.3-fpm-dev
docker pull jopplt/php:8.4-fpm-dev
```
Bundled with:
* Composer
* Node
* Xdebug
* Sqlite
* Bash

Get a shell:
```
docker run --rm -it -v ${PWD}:/app jopplt/php:8.3-fpm-dev bash
docker run --rm -it -v ${PWD}:/app jopplt/php:8.4-fpm-dev bash
```

Install composer dependencies on current folder (with ssh keys):
```
docker run --rm -v ${PWD}:/app -v ~/.ssh:/root/.ssh jopplt/php:8.3-fpm-dev composer install
docker run --rm -v ${PWD}:/app -v ~/.ssh:/root/.ssh jopplt/php:8.4-fpm-dev composer install
```

Custom `xdebug.ini` configuration?:
```
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini jopplt/php:8.3-fpm-dev bash
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini jopplt/php:8.4-fpm-dev bash
```

## Local build & run

```
docker build --tag php:8.3-fpm-dev 8.3
docker build --tag php:8.4-fpm-dev 8.4
```
```
docker run --rm -it -v ${PWD}:/app php:8.3-fpm-dev bash
docker run --rm -it -v ${PWD}:/app php:8.4-fpm-dev bash
```
Loading