Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scaffoldeducation/php8
Docker image with php-fpm 8.0 running on Alpine Linux 3.16 with MongoDB extension installed.
https://github.com/scaffoldeducation/php8
docker fpm nginx phan php8 phpcs phpstan phpunit production quality
Last synced: 23 days ago
JSON representation
Docker image with php-fpm 8.0 running on Alpine Linux 3.16 with MongoDB extension installed.
- Host: GitHub
- URL: https://github.com/scaffoldeducation/php8
- Owner: scaffoldeducation
- Created: 2024-03-01T17:52:52.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T13:38:41.000Z (3 months ago)
- Last Synced: 2024-10-14T06:02:05.715Z (23 days ago)
- Topics: docker, fpm, nginx, phan, php8, phpcs, phpstan, phpunit, production, quality
- Language: Dockerfile
- Homepage:
- Size: 77.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Scaffold PHP 8 Docker Image
A Docker image created on top of [**php-fpm 8.0** official image](https://hub.docker.com/_/php) running on Alpine 3.16. It is a multi-environment/multi-purpose image that has several PHP extensions installed, such as MongoDB and Xdebug for example.
The final size of the images is considerably small if you take into account the content of each image:
```
scaffoldeducation/php8:fpm-dev 277MB
scaffoldeducation/php8:fpm-prod 277MB
scaffoldeducation/php8:nginx-fpm-dev 321MB
scaffoldeducation/php8:nginx-fpm-prod 321MB
scaffoldeducation/php8:quality 341MB
```
> Based on [**kooldev/php**](https://github.com/kool-dev/docker-php) docker image
> _from [Firework Web](https://github.com/fireworkweb)_
**Summary**
- [Usage](#usage)
- [Tags](#tags)
- [Contents](#contents)
- [Core](#core)
- [Tools](#tools)
- [Libs](#libs)
- [PHP Extensions](#php-extensions)
- [Nginx best practices](#nginx-best-practices)
- [Quality Tools](#quality-tools)
- [Check versions](#check-versions)
- [TODO](#todo)
## Usage
```Dockerfile
FROM scaffoldeducation/php8:fpm-dev
FROM scaffoldeducation/php8:fpm-prod
FROM scaffoldeducation/php8:nginx-fpm-dev
FROM scaffoldeducation/php8:nginx-fpm-prod
FROM scaffoldeducation/php8:quality
```
## Tags
| Tag | Description |
|----------------------|----------------------------------------------------------------------------------------------------|
| **`fpm-dev`** | it has a lot of extensions installed, but not `opcache` |
| **`fpm-prod`** | it has everything from `fpm-dev` except `xdebug` and it includes `opcache` |
| **`nginx-fpm-dev`** | based on `fpm-dev`, it has nginx installed with SSL support |
| **`nginx-fpm-prod`** | same above but based on `fpm-prod` |
| **`quality`** | it descends from `fpm-dev` too but its main purpose is to run [code quality tools](#quality-tools) |
## Contents
### Core
- Alpine Linux `3.16`
- php-fpm `8.0.27`
- nginx `1.22.1`
### Tools
- dockerize `0.7.0`
- supervisor `0.6.3`
- composer `2`
### Libs
- **dependencies**: `bash` `freetype` `ghostscript` `gifsicle` `icu` `imagemagick` `jpegoptim` `less` `libjpeg-turbo` `libldap` `libpng` `libpq` `libzip-dev` `openssh-client` `optipng` `pngquant` `procps` `shadow` `su-exec`
- **build-dependencies**: `freetype-dev` `icu-dev` `imagemagick-dev` `libedit-dev` `libjpeg-turbo-dev` `libpng-dev` `libxml2-dev` `linux-headers` `oniguruma-dev` `openldap-dev` `postgresql-dev`
### PHP Extensions
- **`mysqli`** **`mongodb`** **`redis`** **`xdebug`** `bcmath` `calendar` `exif` `gd` `imagick` `intl` `ldap` `mbstring` `opcache` `pcntl` `pdo` `pdo_mysql` `pdo_pgsql` `soap` `sockets` `xml` `zip`
### Nginx best practices
- **`h5bp`** `3.3.0` for nginx performance and security
### Quality Tools
- **`phan`** `5.4.2`
- **`phpcpd`** `6.0.3`
- **`phpcs`** `3.7.2`
- **`php-cs-fixer`** `3.40.0`
- **`phpmd`** `2.14.1`
- **`phpstan`** `1.10.45`
- **`phpunit`** `9.6.13`
## Check versions
```sh
php --ri imagick # 3.7.0
php --ri mongodb # 1.17.0
php --ri pcov # 1.0.11
php --ri redis # 6.0.2
php --ri xdebug # 3.2.2
```
## TODO
- [ ] Allow customize versions of PECL extensions
- [ ] Write tests for SSL support in nginx