{"id":20916188,"url":"https://github.com/yannoff/docker-php-fpm","last_synced_at":"2025-05-13T11:30:28.580Z","repository":{"id":26255309,"uuid":"107772448","full_name":"yannoff/docker-php-fpm","owner":"yannoff","description":"A set of highly configurable PHP-FPM images based on PHP Alpine version, enriched with composer","archived":false,"fork":false,"pushed_at":"2025-01-15T17:54:43.000Z","size":159,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T23:08:40.946Z","etag":null,"topics":["alpine","alpine-linux","composer","docker","dockerhub","fpm","offenbach","php","php-extensions","php-fpm"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yannoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-21T10:49:53.000Z","updated_at":"2025-01-15T17:54:37.000Z","dependencies_parsed_at":"2023-11-28T15:26:51.509Z","dependency_job_id":"6116dd54-87f7-47c6-beaf-90c43e5d4431","html_url":"https://github.com/yannoff/docker-php-fpm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fdocker-php-fpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fdocker-php-fpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fdocker-php-fpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannoff%2Fdocker-php-fpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yannoff","download_url":"https://codeload.github.com/yannoff/docker-php-fpm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932707,"owners_count":21986441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","alpine-linux","composer","docker","dockerhub","fpm","offenbach","php","php-extensions","php-fpm"],"created_at":"2024-11-18T16:20:22.034Z","updated_at":"2025-05-13T11:30:28.568Z","avatar_url":"https://github.com/yannoff.png","language":"Dockerfile","readme":"# yannoff/docker-php-fpm\n\nHome for [yannoff/php-fpm dockerhub repository](https://hub.docker.com/repository/docker/yannoff/php-fpm \"dockerhub\") sources.\n\nA [PHP-FPM](http://php.net/manual/fr/install.fpm.php \"PHP FastCGI Process Manager\") [docker](https://www.docker.com/ \"docker\") image based on [Alpine](https://alpinelinux.org/ \"Alpine Linux\"), with [composer](https://getcomposer.org/ \"composer\") and [offenbach](https://github.com/yannoff/offenbach) installed.\n\n## Available tags\n\n- [8.4-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/8.4/Dockerfile)\n, [8.4](https://github.com/yannoff/docker-php-fpm/blob/master/8.4/Dockerfile)\n- [8.3-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/8.3/Dockerfile)\n, [8.3](https://github.com/yannoff/docker-php-fpm/blob/master/8.3/Dockerfile)\n- [8.2-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/8.2/Dockerfile)\n, [8.2](https://github.com/yannoff/docker-php-fpm/blob/master/8.2/Dockerfile)\n- [8.1-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/8.1/Dockerfile)\n, [8.1](https://github.com/yannoff/docker-php-fpm/blob/master/8.1/Dockerfile)\n- [8.0-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/8.0/Dockerfile)\n, [8.0](https://github.com/yannoff/docker-php-fpm/blob/master/8.0/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [7.4-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/7.4/Dockerfile)\n, [7.4](https://github.com/yannoff/docker-php-fpm/blob/master/7.4/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [7.3-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/7.3/Dockerfile)\n, [7.3](https://github.com/yannoff/docker-php-fpm/blob/master/7.3/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [7.2-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/7.2/Dockerfile)\n, [7.2](https://github.com/yannoff/docker-php-fpm/blob/master/7.2/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [7.1-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/7.1/Dockerfile)\n, [7.1](https://github.com/yannoff/docker-php-fpm/blob/master/7.1/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [7.0-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/7.0/Dockerfile)\n, [7.0](https://github.com/yannoff/docker-php-fpm/blob/master/7.0/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [5.6-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/5.6/Dockerfile)\n, [5.6](https://github.com/yannoff/docker-php-fpm/blob/master/5.6/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n- [5.5-fpm-alpine](https://github.com/yannoff/docker-php-fpm/blob/master/5.5/Dockerfile)\n, [5.5](https://github.com/yannoff/docker-php-fpm/blob/master/5.5/Dockerfile) \u003csup\u003e**(1)**\u003c/sup\u003e\n\n\u003e \u003csup\u003e**(1)**\u003c/sup\u003e _Those PHP versions have now reached their [EOL](https://www.php.net/eol.php)._\u003cbr/\u003e\n\n\n## Usage\n\n- [Dynamically build images](#building-custom-images) for a fine-tuned docker stack\n- [Use pre-compiled images](#using-base-images) to run on-the-fly, one-shot commands\n\n### Building custom images\n\n_Dynamic builds allow for flexible, fine-tuned and featherweight images._\u003cbr/\u003e\n_The recommended way is to [use the repository URL](https://docs.docker.com/engine/reference/commandline/build/#git-repositories) as build context._\n\n\n_**Example:** Integration in a [docker-compose](https://docs.docker.com/compose/compose-file/) stack_\n\n- PHP version `8.0`\n- `gd` and `imap` extensions\n- `patch` extra package install\n- `Europe/Rome` as timezone\n- `laravel/installer` as a composer global package\n- `latest-preview` version of composer\n\n```yaml\n# docker-compose.yaml\nfpm:\n    build:\n        context: https://github.com/yannoff/docker-php-fpm.git#:8.0\n        args:\n            TZ: Europe/Rome\n            PHP_EXTS: gd imap\n            APK_EXTRA: patch\n            PHP_LIBS: laravel/installer\n            COMPOSER_VERSION: latest-preview\n```\n\n*Alternatively, building from the command-line:*\n\n```bash\ndocker                                     \\\n    build                                  \\\n    -t php8.0                              \\\n    --build-arg TZ=\"Europe/Rome\"           \\\n    --build-arg PHP_EXTS=\"gd imap\"         \\\n    --build-arg APK_EXTRA=patch            \\\n    --build-arg PHP_LIBS=laravel/installer \\\n    --build-arg COMPOSER_VERSION=latest-preview   \\\n    git@github.com:yannoff/docker-php-fpm.git#:8.0\n```\n\n\n#### Build arguments reference\n\nThe following [build arguments](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg) are available:\n\n| Build arg  | Description                                                                    | Defaults\n|---         |---                                                                             |---\n| `TZ`       | The timezone to use for the container                                          | `UTC`\n| `PHP_EXTS` | PHP extensions to be installed \u003csup\u003e**(2)**\u003c/sup\u003e                              | `pdo_mysql pdo_pgsql intl opcache bcmath`\n| `APK_BASE` | Base [alpine](https://pkgs.alpinelinux.org/packages) packages to be installed  | `bash git vim`\n| `APK_EXTRA`| Extra [alpine](https://pkgs.alpinelinux.org/packages) packages to be installed | -\n| `PHP_LIBS` | PHP libraries to be installed as composer global dependencies                  | -\n| `COMPOSER_VERSION` | Specific [composer](https://getcomposer.org/download/) version to be installed  \u003csup\u003e**(3)**\u003c/sup\u003e             | `2.2.25`\n| `OFFENBACH_VERSION`     | Alternative [offenbach](https://github.com/yannoff/offenbach) version to be installed  \u003csup\u003e**(4)**\u003c/sup\u003e | `latest`\n| `OFFENBACH_FILENAME`    | Alternative name for the [offenbach](https://github.com/yannoff/offenbach) executable                     | `offenbach`\n| `OFFENBACH_INSTALL_DIR` | Install dir for the [offenbach](https://github.com/yannoff/offenbach) executable                          | `/usr/bin`\n\n\n\u003e **\u003csup\u003e(2)\u003c/sup\u003e** _See the [mlocati/docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer#supported-php-extensions) repository for the full list of supported extensions._\u003cbr/\u003e\n\u003e **\u003csup\u003e(3)\u003c/sup\u003e** _May be `latest-preview`, `latest-stable`, or an exact version - eg: `2.4.0`._\u003cbr/\u003e\n\u003e **\u003csup\u003e(4)\u003c/sup\u003e** _The version **must be** an exact version, eg: `1.6.2`. If left empty, the `latest` release will be used._\n\n\n### Using base images\n\n_On the other hand, the base pre-compiled images from [dockerhub](https://hub.docker.com/repository/docker/yannoff/php-fpm \"dockerhub\") may be convenient to [run](https://docs.docker.com/engine/reference/run/) php or composer commands on the fly, providing a minimal PHP ecosystem._\n\n_**Example:** Creating a new [laravel](https://github.com/laravel/laravel) empty project_\n\n```\ndocker                  \\\n    run                 \\\n    --rm                \\\n    -it                 \\\n    -u $UID:$GID        \\\n    -w /src             \\\n    -v $PWD:/src        \\\n    yannoff/php-fpm:8.0 \\\n    composer create-project --ignore-platform-reqs laravel/laravel acme\n```\n\n\u003e _Since the base image may not contain all of the required PHP extensions, the `--ignore-platform-reqs` switch is recommended_\n\n#### Pre-compiled images defaults\n\n_Pre-compiled images are built with the following default values:_\n\n| Build arg  | Value\n|---                 |---\n| `TZ`               | `Europe/Paris`\n| `PHP_EXTS`         | `intl opcache`\n| `APK_BASE`         | `bash git vim`\n| `APK_EXTRA`        | `openssh`\n| `COMPOSER_VERSION` | `2.2.25`\n\n## Helper scripts\n\nA set of helper scripts are available in the [bin](bin) directory.\n\nEach of them allows to run any php command on-the-fly, including `composer` or `offenbach` commands.\n\nBased on the BusyBox principle, the [bin/php](bin/php) multi-call script is the main entrypoint.\n\nThe way it works is dead simple: php version is deduced from the called script name, as a consequence each `php\u003cversion\u003e` symlink must point to the main [`php`](bin/php) entrypoint script.\n\nThe version must be one of the following:\n `5.5`,\n `5.6`,\n `7.0`,\n `7.1`,\n `7.2`,\n `7.3`,\n `7.4`,\n `8.0`,\n `8.1`,\n `8.2`\n\n\u003e _If invoked without any version suffix, the default PHP version will be used: either the `PHP_VERSION` environment variable (if set), the latest PHP GA release (currently 8.2) otherwise._\n\n### Usage examples\n\n```bash\n$ cd $HOME/bin\n$ ln -s php php7.4\n$ php7.4 --version\nPHP 7.4.28 (cli) (built: Mar 29 2022 03:52:02) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies\n```\n\n_The following examples are given assuming that:_\n- _The `php` multi-call script is in one of the `$PATH` dirs_\n- _A symlink to it has been created for each php version_\n\n#### Install offenbach dependencies in the current dir\n\n```bash\nphp8.1 offenbach install\n```\n\n#### Open a php interactive command prompt\n\n```bash\nphp7.4 -a\n```\n\n#### Open a bash session\n\n```bash\nphp8.0\n```\n\n\n## Credits\n\nLicensed under the [MIT License](https://github.com/yannoff/docker-php-fpm/blob/master/LICENSE).\n\nThis project uses the awesome [mlocati/docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer) script for PHP extensions install.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannoff%2Fdocker-php-fpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyannoff%2Fdocker-php-fpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannoff%2Fdocker-php-fpm/lists"}