Skip to content

Commit e32c9d2

Browse files
josecarlospeer-cloudjorge07
authored andcommitted
docs: rewrite README with devcontainer setup, extension list, Xdebug 3 quickstart
Replaces the minimal 'Documentation' link with inline docs covering: - Image table (PHP version, Alpine, arch, registries) - Quick start for both production and dev images - VS Code Dev Container 3-step setup (devcontainer.json) - Xdebug launch.json config - PHPStorm SSH remote interpreter setup - Xdebug 3 key settings + migration note - Full PHP extensions list (all images) - GHCR badge added alongside Docker Hub
1 parent 232676a commit e32c9d2

1 file changed

Lines changed: 126 additions & 25 deletions

File tree

README.md

Lines changed: 126 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,150 @@
1-
# Alpine PHP
1+
# Alpine PHP
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
33
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

6-
Repository of https://hub.docker.com/r/jorge07/alpine-php
6+
[![PR checks](https://github.com/jorge07/alpine-php/actions/workflows/pr.yaml/badge.svg?branch=master)](https://github.com/jorge07/alpine-php/actions/workflows/pr.yaml)
7+
![Docker Pulls](https://img.shields.io/docker/pulls/jorge07/alpine-php.svg?style=flat-square)
8+
[![Docker Hub](https://img.shields.io/badge/Docker%20Hub-jorge07%2Falpine--php-blue)](https://hub.docker.com/r/jorge07/alpine-php)
9+
[![GHCR](https://img.shields.io/badge/GHCR-ghcr.io%2Fjorge07%2Falpine--php-blue)](https://ghcr.io/jorge07/alpine-php)
710

8-
[![PR checks](https://github.com/jorge07/alpine-php/actions/workflows/pr.yaml/badge.svg?branch=master)](https://github.com/jorge07/alpine-php/actions/workflows/pr.yaml) ![Docker Pulls](https://img.shields.io/docker/pulls/jorge07/alpine-php.svg?style=flat-square)
11+
Lightweight PHP-FPM Docker images based on Alpine Linux — under 40MB.
912

10-
Small PHP Docker images based on Alpine [<40MB].
13+
Kept up to date with [active PHP releases](https://www.php.net/supported-versions.php). Weekly automated rebuilds pick up Alpine security patches.
1114

12-
Up to date with [active releases](https://www.php.net/supported-versions.php) and a place for older unmaintained images.
15+
---
1316

14-
## Documentation
17+
## Images
1518

16-
[Read about Documentation and see some examples here](https://github.com/jorge07/alpine-php/tree/master/doc/README.md)
19+
| Tag | PHP | Alpine | Arch |
20+
|---|---|---|---|
21+
| `8.4` / `8.4-dev` | 8.4.x | edge | amd64, arm64, arm/v7, arm/v8 |
22+
| `8.3` / `8.3-dev` | 8.3.x | 3.20 | amd64, arm64, arm/v7, arm/v8 |
23+
| `8.2` / `8.2-dev` | 8.2.x | 3.21 | amd64, arm64, arm/v7, arm/v8 |
24+
| `8.1` / `8.1-dev` | 8.1.x | 3.19 | amd64, arm64, arm/v7, arm/v8 |
1725

18-
## Images
26+
Available on [Docker Hub](https://hub.docker.com/r/jorge07/alpine-php) and [GHCR](https://ghcr.io/jorge07/alpine-php).
27+
28+
### Deprecated (available but unmaintained)
29+
30+
`8.0` · `7.4` · `7.3` · `7.2` · `7.1` · `5.6`
31+
32+
---
33+
34+
## Quick start
35+
36+
```sh
37+
# Production image — PHP-FPM on port 9000
38+
docker run -d --name php -p 9000:9000 -v $PWD:/app jorge07/alpine-php:8.3
39+
40+
# Dev image — PHP-FPM + Xdebug + Composer + SSH
41+
docker run -d --name php-dev \
42+
-p 2244:22 \
43+
-p 9003:9003 \
44+
-v $PWD:/app \
45+
jorge07/alpine-php:8.3-dev
46+
```
47+
48+
---
49+
50+
## Dev Container (VS Code)
51+
52+
The repo ships a `.devcontainer/devcontainer.json` for use with [VS Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) or [GitHub Codespaces](https://github.com/features/codespaces).
53+
54+
### Get started in 3 steps
55+
56+
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code
57+
2. Open your project folder
58+
3. Click **Reopen in Container** (or run `Dev Containers: Reopen in Container` from the command palette)
59+
60+
VS Code will pull `jorge07/alpine-php:8.3-dev`, mount your project at `/app`, and pre-install:
61+
- [PHP Debug](https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug) (Xdebug 3 integration)
62+
- [Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client) (PHP language server)
63+
64+
### Xdebug launch config
65+
66+
Add `.vscode/launch.json` to your project:
67+
68+
```json
69+
{
70+
"version": "0.2.0",
71+
"configurations": [
72+
{
73+
"name": "Listen for Xdebug",
74+
"type": "php",
75+
"request": "launch",
76+
"port": 9003,
77+
"pathMappings": {
78+
"/app": "${workspaceFolder}"
79+
}
80+
}
81+
]
82+
}
83+
```
84+
85+
Set breakpoints, press **F5**, and trigger a request. For CLI scripts:
86+
87+
```sh
88+
docker exec php-dev sh -c "XDEBUG_SESSION=1 php /app/script.php"
89+
```
90+
91+
---
92+
93+
## Dev images — manual setup
94+
95+
Dev images add Xdebug, Composer, SSH, and Supervisor on top of the production image.
96+
97+
### PHPStorm (SSH remote interpreter)
1998

20-
- [8.3](https://github.com/jorge07/alpine-php/blob/master/8.3/Dockerfile)
21-
- [8.2](https://github.com/jorge07/alpine-php/blob/master/8.2/Dockerfile)
22-
- [8.1](https://github.com/jorge07/alpine-php/blob/master/8.1/Dockerfile)
99+
```sh
100+
docker run -d --name php-dev -p 2244:22 -p 9003:9003 -v $PWD:/app jorge07/alpine-php:8.3-dev
101+
```
102+
103+
**Languages & Frameworks → PHP → Add → SSH Credentials**
23104

24-
# Deprecated but available images
105+
| Field | Value |
106+
|---|---|
107+
| Host | `localhost` |
108+
| Port | `2244` |
109+
| User | `root` |
110+
| Password | `root` |
111+
| PHP executable | `/usr/bin/php` |
25112

26-
- [8.0](https://github.com/jorge07/alpine-php/blob/master/8.0/Dockerfile)
27-
- [7.4](https://github.com/jorge07/alpine-php/blob/master/7.4/Dockerfile)
28-
- [7.3](https://github.com/jorge07/alpine-php/blob/master/7.3/Dockerfile)
29-
- [7.2](https://github.com/jorge07/alpine-php/blob/master/7.2/Dockerfile)
30-
- [7.1](https://github.com/jorge07/alpine-php/blob/master/7.1/Dockerfile)
31-
- [5.6](https://github.com/jorge07/alpine-php/blob/master/5.6/Dockerfile)
113+
**Path mappings:** `<project root>``/app`
32114

33-
## Usage:
115+
**Debug → Xdebug port:** `9003`
116+
117+
### Custom SSH credentials
34118

35119
```sh
36-
docker run -d --name dev -p 2323:22 -v $PWD:/app jorge07/alpine-php:8.3-dev
120+
docker build \
121+
--build-arg USER=myuser \
122+
--build-arg PASSWORD=mypass \
123+
--target dev -t myapp:dev \
124+
-f 8.3/Dockerfile 8.3/
37125
```
38126

39-
> To make xdebug config easier for all environments there's a custom ENVVAR you can define: `XDEBUG_CLIENT_HOST`.
40-
> Example: XDEBUG_CLIENT_HOST=docker.for.mac for OSX, XDEBUG_CLIENT_HOST=docker.for.windows for Windows users and Linux users and Remote interpreters by SSH can leave it empty.
127+
### Xdebug 3 — key settings
128+
129+
| Setting | Value |
130+
|---|---|
131+
| Port | `9003` (changed from 9000 in Xdebug 2) |
132+
| Trigger | `XDEBUG_SESSION=1` env var |
133+
| Mode | `debug` (set in image, trigger-based) |
134+
135+
> **Migrating from Xdebug 2?** See the [IDE integration guide](doc/IDE.md) for a full comparison table and PHPStorm setup walkthrough.
136+
137+
---
138+
139+
## PHP Extensions
140+
141+
All images include:
41142

42-
> SSH is only for IDE integration to use container as remote interpreter
143+
`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`
43144

44-
## Dev Dockerfiles
145+
Dev images additionally include: `xdebug` · `pear`
45146

46-
Dev images extend the standard ones and add some tools for development and CI like, composer, xdebug, etc...
147+
---
47148

48149
## Contributors ✨
49150

0 commit comments

Comments
 (0)