mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
Restructure documentation
This commit is contained in:
183
doc/available-tools.md
Normal file
183
doc/available-tools.md
Normal file
@@ -0,0 +1,183 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
Tools |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Available Tools
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="200">Tool</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td><a href="https://www.ansible.com/">Ansible</a></td>
|
||||
<td>Automation tool.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://asgardcms.com/install">asgardcms</a></td>
|
||||
<td>AsgardCMS cli installer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/cytopia/awesome-ci">awesome-ci</a></td>
|
||||
<td>Various linting and source code analyzing tools.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://codeception.com/">codeception</a></td>
|
||||
<td>Elegant and efficient testing for PHP.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://getcomposer.org">composer</a></td>
|
||||
<td>Dependency Manager for PHP.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://deployer.org/">deployer</a></td>
|
||||
<td>Deployment tool for PHP.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://drupalconsole.com">drupal-console</a></td>
|
||||
<td>The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://www.drush.org">drush</a></td>
|
||||
<td>Drush is a computer software shell-based application used to control, manipulate, and administer Drupal websites.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://eslint.org">eslint</a></td>
|
||||
<td>The pluggable linting utility for JavaScript and JSX.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://git-scm.com">git</a></td>
|
||||
<td>Git is a version control system for tracking changes in source files.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/nvie/gitflow">git-flow</a></td>
|
||||
<td>Git-flow tools.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://gulpjs.com/">gulp</a></td>
|
||||
<td>Gulp command line JS tool.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://gruntjs.com/">grunt</a></td>
|
||||
<td>Grunt command line JS tool.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://brew.sh/">Homebrew</a></td>
|
||||
<td>The Missing Package Manager for macOS (or Linux).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/zaach/jsonlint">jsonlint</a></td>
|
||||
<td>Json command line linter.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://stedolan.github.io/jq/">jq</a></td>
|
||||
<td>Command-line JSON processor.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/laravel/installer">laravel installer</a></td>
|
||||
<td>A CLI tool to easily install and manage the laravel framework.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/cytopia/linkcheck">linkcheck</a></td>
|
||||
<td>Search for URLs in files (optionally limited by extension) and validate their HTTP status code.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/markdownlint/markdownlint">mdl</a></td>
|
||||
<td>Markdown command line linter.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/ChrisWren/mdlint">mdlint</a></td>
|
||||
<td>Markdown command line linter.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://mysqldump-secure.org">mysqldump-secure</a></td>
|
||||
<td>Secury MySQL database backup tool with encryption.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://nodejs.org">nodejs</a></td>
|
||||
<td>Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.npmjs.com">npm</a></td>
|
||||
<td>npm is a package manager for the JavaScript programming language.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/phalcon/phalcon-devtools">phalcon-devtools</a></td>
|
||||
<td>CLI tool to generate code helping to develop faster and easy applications that use with Phalcon framework.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/squizlabs/PHP_CodeSniffer">phpcs</a></td>
|
||||
<td>PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/squizlabs/PHP_CodeSniffer">phpcbf</a></td>
|
||||
<td>PHP Code Beautifier and Fixer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer">php-cs-fixer</a></td>
|
||||
<td>A tool to automatically fix PHP Coding Standards issues.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://phpmd.org">phpmd</a></td>
|
||||
<td>PHP Mess Detector.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://photoncms.com/resources/installing">photon</a></td>
|
||||
<td>Photon CMS cli.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://sass-lang.com/">sass</a></td>
|
||||
<td>Sass CSS compiler.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/stylelint/stylelint">stylelint</a></td>
|
||||
<td>Sass/CSS command line linter.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.openssh.com/">ssh</a></td>
|
||||
<td>OpenSSH command line client.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/symfony/symfony-installer">symfony installer</a></td>
|
||||
<td>This is the official installer to start new projects based on the Symfony full-stack framework.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/jonas/tig">tig</a></td>
|
||||
<td>Text-mode Interface for Git.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/webpack/webpack">webpack</a></td>
|
||||
<td>A bundler for javascript and friends.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://wp-cli.org">wp-cli</a></td>
|
||||
<td>WP-CLI is the command-line interface for WordPress.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/adrienverge/yamllint">yamllint</a></td>
|
||||
<td>Yaml command line linter.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://yarnpkg.com/en">yarn</a></td>
|
||||
<td>Fast, reliable and secure dependency management.</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
27
doc/base-images.md
Normal file
27
doc/base-images.md
Normal file
@@ -0,0 +1,27 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
Base Images
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Base Images
|
||||
|
||||
Have a look at the following Devilbox base images for which no official versions exist yet, but are required to serve as a foundation for this repository:
|
||||
|
||||
* [PHP-FPM 5.2](https://github.com/devilbox/docker-php-fpm-5.2)
|
||||
* [PHP-FPM 5.3](https://github.com/devilbox/docker-php-fpm-5.3)
|
||||
* [PHP-FPM 7.4](https://github.com/devilbox/docker-php-fpm-7.4)
|
||||
* [PHP-FPM 8.0](https://github.com/devilbox/docker-php-fpm-8.0)
|
||||
* [PHP-FPM 8.1](https://github.com/devilbox/docker-php-fpm-8.1)
|
||||
* [PHP-FPM 8.2](https://github.com/devilbox/docker-php-fpm-8.2)
|
||||
116
doc/docker-env-variables.md
Normal file
116
doc/docker-env-variables.md
Normal file
@@ -0,0 +1,116 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
Env Vars |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Have a look at the following table to see all supported environment variables for each Docker image flavour.
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<th>Env Variable</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>base</strong><br/><br/><strong>mods</strong><br/><br/><strong>prod</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>DEBUG_ENTRYPOINT</code></td>
|
||||
<td>int</td>
|
||||
<td><code>0</code></td>
|
||||
<td>Set debug level for startup.<br/><sub><code>0</code> Only warnings and errors are shown.<br/><code>1</code> All log messages are shown<br/><code>2</code> All log messages and executed commands are shown.</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>NEW_UID</code></td>
|
||||
<td>int</td>
|
||||
<td><code>1000</code></td>
|
||||
<td>Assign the PHP-FPM user a new <code>uid</code> in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local user.<br/><sub>(Type <code>id -u</code> for your uid).</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>NEW_GID</code></td>
|
||||
<td>int</td>
|
||||
<td><code>1000</code></td>
|
||||
<td>Assign the PHP-FPM group a new <code>gid</code> in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local group.<br/><sub>(Type <code>id -g</code> for your gid).</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6"><strong>prod</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>TIMEZONE</code></td>
|
||||
<td>string</td>
|
||||
<td><code>UTC</code></td>
|
||||
<td>Set docker OS timezone as well as PHP timezone.<br/>(Example: <code>Europe/Berlin</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DOCKER_LOGS</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>1</code></td>
|
||||
<td>By default all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr. Those which support it can change the behaviour to log into files inside the container. Their respective directories are available as volumes that can be mounted to the host computer. This feature might help developer who are more comfortable with tailing or searching through actual files instead of using docker logs.<br/><br/>Set this variable to <code>0</code> in order to enable logging to files. Log files are avilable under <code>/var/log/php/</code> which is also a docker volume that can be mounted locally.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ENABLE_MODULES</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Comma separated list of PHP modules to enable, which are not enabled by default.<br/><strong>Example:</strong><br/><code>ENABLE_MODULES=blackfire, ioncube, psr, phalcon</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DISABLE_MODULES</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Comma separated list of PHP modules to disable.<br/><strong>Example:</strong><br/><code>DISABLE_MODULES=swoole,imagick</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ENABLE_MAIL</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>0</code></td>
|
||||
<td>Start local postfix with or without email catch-all.<br/><code>0</code>: Postfix service disabled.<br/><code>1</code>: Postfix service started normally.<br/><code>2</code>: Postfix service started configured for local delivery and all mails sent (even to real domains) will be catched locally. No email will ever go out. They will all be stored in a local devilbox account.<br/>Value: <code>0</code>, <code>1</code> or <code>2</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>FORWARD_PORTS_TO_LOCALHOST</code></td>
|
||||
<td>string</td>
|
||||
<td></td>
|
||||
<td>List of remote ports to forward to 127.0.0.1.<br/><strong>Format:</strong><br/><sub><code><local-port>:<remote-host>:<remote-port></code></sub><br/>You can separate multiple entries by comma.<br/><strong>Example:</strong><br/><sub><code>3306:mysqlhost:3306, 6379:192.0.1.1:6379</code></sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>work</strong></td>
|
||||
<td><code>MYSQL_BACKUP_USER</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Username for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MYSQL_BACKUP_PASS</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Password for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MYSQL_BACKUP_HOST</code></td>
|
||||
<td>string</td>
|
||||
<td><code>''</code></td>
|
||||
<td>Hostname for mysql backups used for bundled <a href="https://mysqldump-secure.org" >mysqldump-secure</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
298
doc/docker-tags.md
Normal file
298
doc/docker-tags.md
Normal file
@@ -0,0 +1,298 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
Tags |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Docker Tags
|
||||
|
||||
#### Tagging Idea
|
||||
|
||||
This repository uses Docker tags to refer to different flavours and types of the PHP-FPM Docker image. Therefore `:latest` and `:<git-branch-name>` as well as `:<git-tag-name>` must be presented differently. Refer to the following table to see how tagged Docker images are produced at Docker hub:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="190">Meant Tag</th>
|
||||
<th width="300">Actual Tag</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>:latest</code></td>
|
||||
<td>
|
||||
<code>:X.Y-base</code><br/>
|
||||
<code>:X.Y-mods</code><br/>
|
||||
<code>:X.Y-prod</code><br/>
|
||||
<code>:X.Y-work</code><br/>
|
||||
</td>
|
||||
<td>Stable<br/><sub>(rolling)</sub><br/><br/>These tags are produced by the master branch of this repository.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>:<git-tag-name></code></td>
|
||||
<td>
|
||||
<code>:X.Y-base-<git-tag-name></code><br/>
|
||||
<code>:X.Y-mods-<git-tag-name></code><br/>
|
||||
<code>:X.Y-prod-<git-tag-name></code><br/>
|
||||
<code>:X.Y-work-<git-tag-name></code><br/>
|
||||
</td>
|
||||
<td>Stable<br/><sub>(fixed)</sub><br/><br/>Every git tag will produce and preserve these Docker tags.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>:<git-branch-name></code></td>
|
||||
<td>
|
||||
<code>:X.Y-base-<git-branch-name></code><br/>
|
||||
<code>:X.Y-mods-<git-branch-name></code><br/>
|
||||
<code>:X.Y-prod-<git-branch-name></code><br/>
|
||||
<code>:X.Y-work-<git-branch-name></code><br/>
|
||||
</td>
|
||||
<td>Feature<br/><sub>(for testing)</sub><br/><br/>Tags produced by unmerged branches. Do not rely on them as they might come and go.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
#### Available Docker Tags
|
||||
|
||||
The following table shows a more complete overview about the offered Docker image tags.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Flavour</th>
|
||||
<th>Master Branch</th>
|
||||
<th>Git Tag</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td rowspan="13"><strong>base</strong></td>
|
||||
<td><code>devilbox/php-fpm:5.2-base</code></td>
|
||||
<td><code>devilbox/php-fpm:5.2-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.3-base</code></td>
|
||||
<td><code>devilbox/php-fpm:5.3-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.4-base</code></td>
|
||||
<td><code>devilbox/php-fpm:5.4-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.5-base</code></td>
|
||||
<td><code>devilbox/php-fpm:5.5-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.6-base</code></td>
|
||||
<td><code>devilbox/php-fpm:5.6-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.0-base</code></td>
|
||||
<td><code>devilbox/php-fpm:7.0-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.1-base</code></td>
|
||||
<td><code>devilbox/php-fpm:7.1-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.2-base</code></td>
|
||||
<td><code>devilbox/php-fpm:7.2-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.3-base</code></td>
|
||||
<td><code>devilbox/php-fpm:7.3-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.4-base</code></td>
|
||||
<td><code>devilbox/php-fpm:7.4-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.0-base</code></td>
|
||||
<td><code>devilbox/php-fpm:8.0-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.1-base</code></td>
|
||||
<td><code>devilbox/php-fpm:8.1-base-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.2-base</code></td>
|
||||
<td><code>devilbox/php-fpm:8.2-base-<git-tag></code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="13"><strong>mods</strong></td>
|
||||
<td><code>devilbox/php-fpm:5.2-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:5.2-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.3-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:5.3-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.4-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:5.4-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.5-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:5.5-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.6-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:5.6-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.0-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:7.0-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.1-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:7.1-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.2-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:7.2-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.3-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:7.3-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.4-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:7.4-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.0-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:8.0-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.1-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:8.1-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.2-mods</code></td>
|
||||
<td><code>devilbox/php-fpm:8.2-mods-<git-tag></code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="13"><strong>prod</strong></td>
|
||||
<td><code>devilbox/php-fpm:5.2-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:5.2-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.3-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:5.3-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.4-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:5.4-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.5-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:5.5-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.6-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:5.6-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.0-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:7.0-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.1-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:7.1-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.2-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:7.2-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.3-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:7.3-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.4-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:7.4-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.0-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:8.0-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.1-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:8.1-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.2-prod</code></td>
|
||||
<td><code>devilbox/php-fpm:8.2-prod-<git-tag></code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="13"><strong>work</strong></td>
|
||||
<td><code>devilbox/php-fpm:5.2-work</code></td>
|
||||
<td><code>devilbox/php-fpm:5.2-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.3-work</code></td>
|
||||
<td><code>devilbox/php-fpm:5.3-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.4-work</code></td>
|
||||
<td><code>devilbox/php-fpm:5.4-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.5-work</code></td>
|
||||
<td><code>devilbox/php-fpm:5.5-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:5.6-work</code></td>
|
||||
<td><code>devilbox/php-fpm:5.6-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.0-work</code></td>
|
||||
<td><code>devilbox/php-fpm:7.0-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.1-work</code></td>
|
||||
<td><code>devilbox/php-fpm:7.1-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.2-work</code></td>
|
||||
<td><code>devilbox/php-fpm:7.2-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.3-work</code></td>
|
||||
<td><code>devilbox/php-fpm:7.3-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:7.4-work</code></td>
|
||||
<td><code>devilbox/php-fpm:7.4-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.0-work</code></td>
|
||||
<td><code>devilbox/php-fpm:8.0-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.1-work</code></td>
|
||||
<td><code>devilbox/php-fpm:8.1-work-<git-tag></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>devilbox/php-fpm:8.2-work</code></td>
|
||||
<td><code>devilbox/php-fpm:8.2-work-<git-tag></code></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
83
doc/docker-volumes.md
Normal file
83
doc/docker-volumes.md
Normal file
@@ -0,0 +1,83 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
Volumes |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Docker Volumes
|
||||
|
||||
Have a look at the following table to see all offered volumes for each Docker image flavour.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<th width="240">Volumes</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan="8"><strong>prod</strong><br/><br/><strong>work</strong></td>
|
||||
<td><code>/etc/php-custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom <code>\*.ini</code> files in order to alter php behaviour.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/php-fpm-custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom PHP-FPM <code>\*.conf</code> files in order to alter PHP-FPM behaviour.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/php-modules.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custo <code>\*.so</code> files in order to add your php modules.<br/><br/><strong>Note:</strong>Your should then also provide a custom <code>\*.ini</code> file in order to actually load your custom provided module.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/startup.1.d</code></td>
|
||||
<td>Any executable scripts ending by <code>\*.sh</code> found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run before <code>/startup.2.d</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/startup.2.d</code></td>
|
||||
<td>Any executable scripts ending by <code>\*.sh</code> found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run after <code>/startup.1.d</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/var/log/php</code></td>
|
||||
<td>When setting environment variable <code>DOCKER_LOGS</code> to <code>0</code>, log files will be available under this directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/var/mail</code></td>
|
||||
<td>Emails caught be the postfix catch-all (<code>ENABLE_MAIL=2</code>) will be available in this directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/etc/supervisor/custom.d</code></td>
|
||||
<td>Mount this directory into your host computer and add your own `*.conf` supervisor start-up files.<br/><br/>**Note:** Directory and file permission will be recursively set to this of `NEW_UID` and `NEW_GID`.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3"><strong>work</strong></td>
|
||||
<td><code>/etc/bashrc-devilbox.d</code></td>
|
||||
<td>Mount this directory into your host computer and add custom configuration files for <code>bash</code> and other tools.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/shared/backups</code></td>
|
||||
<td>Mount this directory into your host computer to access MySQL backups created by <a href="https://mysqldump-secure.org" >mysqldump-secure</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/ca</code></td>
|
||||
<td>Mount this directory into your host computer to bake any *.crt file that is located in there as a trusted SSL entity.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
34
doc/flavours.md
Normal file
34
doc/flavours.md
Normal file
@@ -0,0 +1,34 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
Flavours |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Flavours
|
||||
|
||||
#### Image: base
|
||||
|
||||
Generic PHP-FPM base image. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.<br/><sub>(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`)</sub>
|
||||
|
||||
#### Image: mods
|
||||
|
||||
Generic PHP-FPM image with fully loaded extensions. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.<br/><sub>(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`)</sub>
|
||||
|
||||
#### Image: prod
|
||||
|
||||
Devilbox production image. This Docker image comes with many injectables, port-forwardings, mail-catch-all and user/group rewriting.
|
||||
|
||||
#### Image: work
|
||||
|
||||
Devilbox development image. Same as prod, but comes with lots of locally installed tools to make development inside the container as convenient as possible. See [Integrated Development Environment](../README.md#integrated-development-environment) for more information about this.
|
||||
34
doc/php-versions.md
Normal file
34
doc/php-versions.md
Normal file
@@ -0,0 +1,34 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
Versions |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Available PHP versions
|
||||
|
||||
| Version | Architecture | Flavours |
|
||||
|---------------|---------------|----------|
|
||||
| **`PHP 5.2`** | amd64 | [base](../Dockerfiles/base/Dockerfile-5.2), [mods](../Dockerfiles/mods/Dockerfile-5.2), [prod](../Dockerfiles/prod/Dockerfile-5.2), [work](../Dockerfiles/work/Dockerfile-5.2) |
|
||||
| **`PHP 5.3`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.3), [mods](../Dockerfiles/mods/Dockerfile-5.3), [prod](../Dockerfiles/prod/Dockerfile-5.3), [work](../Dockerfiles/work/Dockerfile-5.3) |
|
||||
| **`PHP 5.4`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.4), [mods](../Dockerfiles/mods/Dockerfile-5.4), [prod](../Dockerfiles/prod/Dockerfile-5.4), [work](../Dockerfiles/work/Dockerfile-5.4) |
|
||||
| **`PHP 5.5`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.5), [mods](../Dockerfiles/mods/Dockerfile-5.5), [prod](../Dockerfiles/prod/Dockerfile-5.5), [work](../Dockerfiles/work/Dockerfile-5.5) |
|
||||
| **`PHP 5.6`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.6), [mods](../Dockerfiles/mods/Dockerfile-5.6), [prod](../Dockerfiles/prod/Dockerfile-5.6), [work](../Dockerfiles/work/Dockerfile-5.6) |
|
||||
| **`PHP 7.0`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.0), [mods](../Dockerfiles/mods/Dockerfile-7.0), [prod](../Dockerfiles/prod/Dockerfile-7.0), [work](../Dockerfiles/work/Dockerfile-7.0) |
|
||||
| **`PHP 7.1`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.1), [mods](../Dockerfiles/mods/Dockerfile-7.1), [prod](../Dockerfiles/prod/Dockerfile-7.1), [work](../Dockerfiles/work/Dockerfile-7.1) |
|
||||
| **`PHP 7.2`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.2), [mods](../Dockerfiles/mods/Dockerfile-7.2), [prod](../Dockerfiles/prod/Dockerfile-7.2), [work](../Dockerfiles/work/Dockerfile-7.2) |
|
||||
| **`PHP 7.3`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.3), [mods](../Dockerfiles/mods/Dockerfile-7.3), [prod](../Dockerfiles/prod/Dockerfile-7.3), [work](../Dockerfiles/work/Dockerfile-7.3) |
|
||||
| **`PHP 7.4`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.4), [mods](../Dockerfiles/mods/Dockerfile-7.4), [prod](../Dockerfiles/prod/Dockerfile-7.4), [work](../Dockerfiles/work/Dockerfile-7.4) |
|
||||
| **`PHP 8.0`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.0), [mods](../Dockerfiles/mods/Dockerfile-8.0), [prod](../Dockerfiles/prod/Dockerfile-8.0), [work](../Dockerfiles/work/Dockerfile-8.0) |
|
||||
| **`PHP 8.1`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.1), [mods](../Dockerfiles/mods/Dockerfile-8.1), [prod](../Dockerfiles/prod/Dockerfile-8.1), [work](../Dockerfiles/work/Dockerfile-8.1) |
|
||||
| **`PHP 8.2`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.2), [mods](../Dockerfiles/mods/Dockerfile-8.2), [prod](../Dockerfiles/prod/Dockerfile-8.2), [work](../Dockerfiles/work/Dockerfile-8.2) |
|
||||
25
doc/supported-architectures.md
Normal file
25
doc/supported-architectures.md
Normal file
@@ -0,0 +1,25 @@
|
||||
[Permissions](syncronize-file-permissions.md) |
|
||||
[Tags](docker-tags.md) |
|
||||
Architectures |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Supported Architectures
|
||||
|
||||
The following architectures are supported for **Linux**, **MacOS** and **Windows**
|
||||
|
||||
| Arch | PHP Version |
|
||||
|---------|-------------|
|
||||
| `amd64` | `5.2`, `5.3`, `5.4`, `5.5`, `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2` |
|
||||
| `arm64` | `5.3`, `5.4`, `5.5`, `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2` |
|
||||
89
doc/syncronize-file-permissions.md
Normal file
89
doc/syncronize-file-permissions.md
Normal file
@@ -0,0 +1,89 @@
|
||||
Permissions |
|
||||
[Tags](docker-tags.md) |
|
||||
[Architectures](supported-architectures.md) |
|
||||
[Versions](php-versions.md) |
|
||||
[Flavours](flavours.md) |
|
||||
[Extensions](php-modules.md) |
|
||||
[Tools](available-tools.md) |
|
||||
[Env Vars](docker-env-variables.md) |
|
||||
[Volumes](docker-volumes.md) |
|
||||
[Base Images](base-images.md)
|
||||
|
||||
---
|
||||
|
||||
<h2><img name="Documentation" title="Documentation" width="20" src="https://github.com/devilbox/artwork/raw/master/submissions_logo/cytopia/01/png/logo_64_trans.png"> Documentation</h2>
|
||||
|
||||
|
||||
|
||||
### Motivation
|
||||
|
||||
One main problem with a running Docker container is to **synchronize the ownership of files in a mounted volume** in order to preserve security (Not having to use `chmod 0777`).
|
||||
|
||||
|
||||
### Unsynchronized permissions
|
||||
|
||||
Consider the following directory structure of a mounted volume. Your hosts computer uid/gid are `1000` which does not have a corresponding user/group within the container. Fortunately the `tmp/` directory allows everybody to create new files in it.
|
||||
|
||||
```shell
|
||||
[Host] | [Container]
|
||||
------------------------------------------------------------------------------------------
|
||||
$ ls -l | $ ls -l
|
||||
-rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php
|
||||
drwxrwxrwx user group tmp/ | drwxrwxrwx 1000 1000 tmp/
|
||||
```
|
||||
|
||||
Your web application might now have created some temporary files (via the PHP-FPM process) inside the `tmp/` directory:
|
||||
|
||||
```shell
|
||||
[Host] | [Container]
|
||||
------------------------------------------------------------------------------------------
|
||||
$ ls -l tmp/ | $ ls -l tmp/
|
||||
-rw-r--r-- 96 96 _tmp_cache01.php | -rw-r--r-- www www _tmp_cache01.php
|
||||
-rw-r--r-- 96 96 _tmp_cache02.php | -rw-r--r-- www www _tmp_cache01.php
|
||||
```
|
||||
|
||||
On the Docker container side everything is still fine, but on your host computers side, those files now show a user id and group id of `96`, which is in fact the uid/gid of the PHP-FPM process running inside the container. On the host side you will now have to use `sudo` in order to delete/edit those files.
|
||||
|
||||
|
||||
### It gets even worse
|
||||
|
||||
Consider your had created the `tmp/` directory on your host only with `0775` permissions:
|
||||
|
||||
```shell
|
||||
[Host] | [Container]
|
||||
------------------------------------------------------------------------------------------
|
||||
$ ls -l | $ ls -l
|
||||
-rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php
|
||||
drwxrwxr-x user group tmp/ | drwxrwxr-x 1000 1000 tmp/
|
||||
```
|
||||
|
||||
If your web application now wants to create some temporary files (via the PHP-FPM process) inside the `tmp/` directory, it will fail due to lacking permissions.
|
||||
|
||||
|
||||
### The solution
|
||||
|
||||
To overcome this problem, it must be made sure that the PHP-FPM process inside the container runs under the same uid/gid as your local user that mouns the volumes and also wants to work on those files locally. However, you never know during Image build time what user id this would be. Therefore it must be something that can be changed during startup of the container.
|
||||
|
||||
This is achieved by two environment variables that can be provided during startup in order to change the uid/gid of the PHP-FPM user prior starting up PHP-FPM.
|
||||
|
||||
```shell
|
||||
$ docker run -e NEW_UID=1000 -e NEW_GID=1000 -it devilbox/php-fpm:7.2-base
|
||||
[INFO] Changing user 'devilbox' uid to: 1000
|
||||
root $ usermod -u 1000 devilbox
|
||||
[INFO] Changing group 'devilbox' gid to: 1000
|
||||
root $ groupmod -g 1000 devilbox
|
||||
[INFO] Starting PHP 7.2.0 (fpm-fcgi) (built: Oct 30 2017 12:05:19)
|
||||
```
|
||||
|
||||
When **`NEW_UID`** and **`NEW_GID`** are provided to the startup command, the container will do a `usermod` and `groupmod` prior starting up in order to assign new uid/gid to the PHP-FPM user. When the PHP-FPM process finally starts up it actually runs with your local system user and making sure permissions will be in sync from now on.
|
||||
|
||||
At a minimum those two environment variables are offered by all flavours and types of the here provided PHP-FPM images.
|
||||
|
||||
**Note:**
|
||||
|
||||
To tackle this on the PHP-FPM side is only half a solution to the problem. The same applies to a web server Docker container when you offer **file uploads**. They will be uploaded and created by the web servers uid/gid. Therefore the web server itself must also provide the same kind of solution. See the following Web server Docker images for how this is done:
|
||||
|
||||
**[Apache 2.2](https://github.com/devilbox/docker-apache-2.2)** |
|
||||
**[Apache 2.4](https://github.com/devilbox/docker-apache-2.4)** |
|
||||
**[Nginx stable](https://github.com/devilbox/docker-nginx-stable)** |
|
||||
**[Nginx mainline](https://github.com/devilbox/docker-nginx-mainline)**
|
||||
Reference in New Issue
Block a user