-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
The documentation had countless misspellings etc.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
# Docker PHP FPM images for development use | ||
|
||
This is a PHP FPM Docker image tuned to be used in Docker Compose | ||
setups for devlopment environments. | ||
This is a PHP FPM Docker image tuned to be used in Docker Compose setups for development environments. | ||
Check failure on line 3 in README.md GitHub Actions / markdownLine length
|
||
|
||
We have tried to hit a sweet stuff between not doing too much magic, | ||
but still be an easy fit for how we do work at [Reload | ||
A/S](https://reload.dk). | ||
We have tried to hit a sweet stuff between not doing too much magic, but still be an easy fit for how we do work at [Reload A/S](https://reload.dk). | ||
Check failure on line 5 in README.md GitHub Actions / markdownLine length
|
||
|
||
A simple example of usage would be having a `php` service providing | ||
FPM like this: | ||
A simple example of usage would be having a `php` service providing FPM like this: | ||
|
||
```yaml | ||
services: | ||
|
@@ -28,42 +24,27 @@ services: | |
We provide PHP 8.0, 8.1, and 8.2 images. | ||
PHP 7.x versions are no longer supported upstream so we won't provide | ||
them either. | ||
PHP 7.x versions are no longer supported upstream, so we won't provide them either. | ||
The images are based on the official [`php:8.x-fpm-alpine` Docker | ||
images](https://hub.docker.com/_/php). We build new images when new | ||
upstream versions are released. | ||
The images are based on the official [`php:8.x-fpm-alpine` Docker images](https://hub.docker.com/_/php). We build new images when new upstream versions are released. | ||
Check failure on line 29 in README.md GitHub Actions / markdownLine length
|
||
|
||
The image has some PHP settings set for devlopment / debuging use, see | ||
[`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini). They | ||
can be disabled with `no-debug` feature mentioned later in this | ||
document. | ||
The image has some PHP settings set for development / debugging use, see [`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini). They can be disabled with `no-debug` feature mentioned later in this document. | ||
Check failure on line 31 in README.md GitHub Actions / markdownLine length
|
||
|
||
## User | ||
|
||
The images are designed to be able to run as root inside the container | ||
or as uid `501` (MacOS typical user ID) or uid `1000` (Linux typical | ||
user ID). Other user ID's might work as well. | ||
The images are designed to be able to run as root inside the container or as UID `501` (macOS typical user ID) or UID `1000` (Linux typical user ID). Other user ID's might work as well. | ||
Check failure on line 35 in README.md GitHub Actions / markdownLine length
|
||
|
||
This being an image for development use we have installed `sudo` and | ||
configured all users in the container to use it without providing a | ||
password. | ||
This being an image for development use, we have installed `sudo` and configured all users in the container to use it without providing a password. | ||
Check failure on line 37 in README.md GitHub Actions / markdownLine length
|
||
|
||
## Volumes | ||
|
||
We recommend mounting the project root of your repository into the | ||
Docker workdir, `/var/www`. | ||
We recommend mounting the project root of your repository into the Docker workdir, `/var/www`. | ||
Check failure on line 41 in README.md GitHub Actions / markdownLine length
|
||
|
||
## PHP Document root | ||
|
||
FPM exptects PHP's document root to be located in `/var/www/web`. That | ||
would be a `web` folder inside your project root if you follow our | ||
practice. | ||
FPM expects PHP's document root to be located in `/var/www/web`. That would be a `web` folder inside your project root if you follow our practice. | ||
Check failure on line 45 in README.md GitHub Actions / markdownLine length
|
||
|
||
If you would like the document root to be located elsewhere you should | ||
set the environment variable `PHP_DOCUMENT_ROOT` to the desired | ||
location. | ||
If you would like the document root to be located elsewhere, you should set the environment variable `PHP_DOCUMENT_ROOT` to the desired location. | ||
Check failure on line 47 in README.md GitHub Actions / markdownLine length
|
||
|
||
## PHP extensions | ||
|
||
|
@@ -112,23 +93,17 @@ The images come with the following extensions installed and enabled: | |
- xsl | ||
- zip | ||
|
||
In addtion the `xdebug` and `blackfire` extensions are installed but | ||
not enabled in the images. | ||
In addition, the `xdebug` and `blackfire` extensions are installed but not enabled in the images. | ||
Check failure on line 96 in README.md GitHub Actions / markdownLine length
|
||
|
||
The | ||
[php-extension-installer](https://github.com/mlocati/docker-php-extension-installer) | ||
tool is installed if you want to install addtional extensions your self. | ||
The [php-extension-installer](https://github.com/mlocati/docker-php-extension-installer) tool is installed if you want to install additional extensions yourself. | ||
|
||
## Entrypoint scripts | ||
## Entry point scripts | ||
|
||
If you place executables (e.g. by mounting them there) in | ||
`/etc/entrypoint.d` they will be run prior to starting FPM. | ||
If you place executables (e.g., by mounting them there) in `/etc/entrypoint.d` they will be run before starting FPM. | ||
|
||
## Reloading php-fpm | ||
|
||
If you have changed PHP configuration or enabled or disabled some PHP | ||
extensions you can restart the `php-fpm` process with the | ||
`/usr/local/bin/reload` command. E.g. | ||
If you have changed PHP configuration or enabled or disabled some PHP extensions, you can restart the `php-fpm` process with the `/usr/local/bin/reload` command. E.g. | ||
|
||
```console | ||
docker compose exec php reload | ||
|
@@ -138,38 +113,29 @@ docker compose exec php reload | |
|
||
The images come with a concept called "features". | ||
|
||
Features a predefined entrypoint scripts with common functionality you | ||
can opt-in to using. | ||
Features a predefined entry point scripts with common functionality you can opt in to using. | ||
|
||
Features a run prior to the entrypoint scripts mentioned before. | ||
Features a run before the entry point scripts mentioned before. | ||
|
||
You opt-in to using them by setting the `USE_FEATURES` to a space | ||
separated list of their names. | ||
You opt in to using them by setting the `USE_FEATURES` to a space separated list of their names. | ||
|
||
### `install-composer-extensions` feature | ||
|
||
If you have a `composer.json` in your workdir (`/var/www`) this | ||
feature will locate requied depenencies on PHP extensions `ext-*` and | ||
install them using the aforementioned `php-extension-installer` tool. | ||
If you have a `composer.json` in your workdir (`/var/www`) this feature will locate required dependencies on PHP extensions `ext-*` and install them using the aforementioned `php-extension-installer` tool. | ||
|
||
Notice: if this needs to install a lot of libraries and do a lot | ||
compilation this could take quite some time when creating the container. | ||
Notice: if this needs to install numerous libraries and do a lot of compilation, this could take quite some time when creating the container. | ||
|
||
### `root-php-ini` feature | ||
|
||
If you have a `php.ini` in your workdir (`/var/www`) this will be | ||
loaded by FPM. | ||
If you have a `php.ini` in your workdir (`/var/www`) this will be loaded by FPM. | ||
|
||
### `no-debug` feature | ||
|
||
Disable the PHP ini settings in | ||
[`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini). | ||
Disable the PHP ini settings in [`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini). | ||
|
||
### `update-ca-certificates` | ||
|
||
If your container needs to use custom CA certificates place them in | ||
`/usr/local/share/ca-certificates/` using volumes and use the feature | ||
`update-ca-certificates`. | ||
If your container needs to use custom CA certificates, place them in `/usr/local/share/ca-certificates/` using volumes and using the feature `update-ca-certificates`. | ||
|
||
```yaml | ||
services: | ||
|
@@ -185,32 +151,25 @@ services: | |
|
||
## Xdebug | ||
|
||
Xdebug is disabled by default but the extension is available. To | ||
enable the xdebug-extension execute `/usr/local/bin/xdebug` via | ||
Docker, e.g.: | ||
Xdebug is disabled by default, but the extension is available. To enable the xdebug-extension execute `/usr/local/bin/xdebug` via Docker, e.g., | ||
|
||
```console | ||
docker exec -it <container id> xdebug | ||
``` | ||
|
||
Or via Docker Compose, e.g. if the image is used by a service called | ||
`php`: | ||
Or via Docker Compose, e.g., if the image is used by a service called `php`: | ||
|
||
```console | ||
docker compose exec php xdebug | ||
``` | ||
|
||
The script keeps xdebug enabled while running and is terminated by | ||
typing enter. | ||
The script keeps xdebug enabled while running and is terminated by typing enter. | ||
|
||
## Blackfire | ||
|
||
In order to send profiles to Blackfire, you'll need to have a | ||
Blackfire agent reachable by the php-fpm image and the appropriate | ||
credentials. | ||
To send profiles to Blackfire, you'll need to have a Blackfire agent, reachable by the php-fpm image and the appropriate credentials. | ||
|
||
Providing an agent in docker compose is easy, as it's just starting | ||
the orignial Blackfire image. | ||
Providing an agent in docker compose is easy, as it's just starting the original Blackfire image. | ||
|
||
```yaml | ||
php: | ||
|
@@ -225,17 +184,13 @@ the orignial Blackfire image. | |
BLACKFIRE_SERVER_TOKEN: <your server token> | ||
``` | ||
|
||
The correct id's and tokens can be found by viewing the [Blackfire | ||
setup documentation](https://blackfire.io/docs/php/configuration) when | ||
logged in. | ||
The correct ID's and tokens can be found by viewing the [Blackfire setup documentation](https://blackfire.io/docs/php/configuration) when logged in. | ||
|
||
|
||
The image has [`mstmp`](https://marlam.de/msmtp/) installed. `msmtp` | ||
is an SMTP client. | ||
The image has [`mstmp`](https://marlam.de/msmtp/) installed. `msmtp` is an SMTP client. | ||
|
||
For simple development setups we recommend combining it with | ||
[Mailpit](https://github.com/axllent/mailpit): | ||
For simple development setups, we recommend combining it with [Mailpit](https://github.com/axllent/mailpit): | ||
|
||
```yaml | ||
php: | ||
|
@@ -252,5 +207,4 @@ For simple development setups we recommend combining it with | |
MP_UI_BIND_ADDR: '0.0.0.0:80' | ||
``` | ||
|
||
For more advanced usages you can add a system wide configuration file | ||
for msmtp at `/etc/msmtprc` in the php-fpm image. | ||
For more advanced usages, you can add a system-wide configuration file for msmtp at `/etc/msmtprc` in the php-fpm image. |