Lightweight PHP-FPM Docker images based on Alpine Linux — under 40MB.
Kept up to date with active PHP releases. Weekly automated rebuilds pick up Alpine security patches.
| Tag | PHP | Alpine | Arch |
|---|---|---|---|
8.4 / 8.4-dev |
8.4.x | edge | amd64, arm64, arm/v7, arm/v8 |
8.3 / 8.3-dev |
8.3.x | 3.20 | amd64, arm64, arm/v7, arm/v8 |
8.2 / 8.2-dev |
8.2.x | 3.21 | amd64, arm64, arm/v7, arm/v8 |
8.1 / 8.1-dev |
8.1.x | 3.19 | amd64, arm64, arm/v7, arm/v8 |
Available on Docker Hub and GHCR.
8.0 · 7.4 · 7.3 · 7.2 · 7.1 · 5.6
# Production image — PHP-FPM on port 9000
docker run -d --name php -p 9000:9000 -v $PWD:/app jorge07/alpine-php:8.3
# Dev image — PHP-FPM + Xdebug + Composer + SSH
docker run -d --name php-dev \
-p 2244:22 \
-p 9003:9003 \
-v $PWD:/app \
jorge07/alpine-php:8.3-devThe repo ships a .devcontainer/devcontainer.json for use with VS Code Dev Containers or GitHub Codespaces.
- Install the Dev Containers extension in VS Code
- Open your project folder
- Click Reopen in Container (or run
Dev Containers: Reopen in Containerfrom the command palette)
VS Code will pull jorge07/alpine-php:8.3-dev, mount your project at /app, and pre-install:
- PHP Debug (Xdebug 3 integration)
- Intelephense (PHP language server)
Add .vscode/launch.json to your project:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}"
}
}
]
}Set breakpoints, press F5, and trigger a request. For CLI scripts:
docker exec php-dev sh -c "XDEBUG_SESSION=1 php /app/script.php"Dev images add Xdebug, Composer, SSH, and Supervisor on top of the production image.
docker run -d --name php-dev -p 2244:22 -p 9003:9003 -v $PWD:/app jorge07/alpine-php:8.3-devLanguages & Frameworks → PHP → Add → SSH Credentials
| Field | Value |
|---|---|
| Host | localhost |
| Port | 2244 |
| User | root |
| Password | root |
| PHP executable | /usr/bin/php |
Path mappings: <project root> → /app
Debug → Xdebug port: 9003
docker build \
--build-arg USER=myuser \
--build-arg PASSWORD=mypass \
--target dev -t myapp:dev \
-f 8.3/Dockerfile 8.3/| Setting | Value |
|---|---|
| Port | 9003 (changed from 9000 in Xdebug 2) |
| Trigger | XDEBUG_SESSION=1 env var |
| Mode | debug (set in image, trigger-based) |
Migrating from Xdebug 2? See the IDE integration guide for a full comparison table and PHPStorm setup walkthrough.
All images include:
bcmath · ctype · curl · dom · exif · fileinfo · gd · iconv · intl · mbstring · opcache · openssl · pcntl · pdo · pdo_mysql · pdo_pgsql · phar · session · simplexml · sodium · tokenizer · xml · xmlreader · xsl · zip · zlib · apcu
Dev images additionally include: xdebug · pear
Thanks goes to these wonderful people (emoji key):
Kajetan 💻 |
Luis 💻 |
Krzysztof Kowalski 💻 |
Ismael 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!