Building Custom Docker Image
FrankenPHP Docker images are based on official PHP images. Debian and Alpine Linux variants are provided for popular architectures. Debian variants are recommended.
Variants for PHP 8.2, 8.3 and 8.4 are provided.
The tags follow this pattern: dunglas/frankenphp:<frankenphp-version>-php<php-version>-<os>
<frankenphp-version>
and <php-version>
are version numbers of FrankenPHP and PHP respectively, ranging from major (e.g. 1
), minor (e.g. 1.2
) to patch versions (e.g. 1.2.3
).
<os>
is either bookworm
(for Debian Bookworm) or alpine
(for the latest stable version of Alpine).
Browse tags.
# How to Use The Images
Create a Dockerfile
in your project:
`FROM dunglas/frankenphp
COPY . /app/public
`
Then, run these commands to build and run the Docker image:
docker build -t my-php-app .
docker run -it --rm --name my-running-app my-php-app
# How to Install More PHP Extensions
The docker-php-extension-installer
script is provided in the base image. Adding additional PHP extensions is straightforward:
`FROM dunglas/frankenphp
add additional extensions here:
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
zip \
opcache`