Alpine-based Docker container with nginx and php-fpm.
Go to file
Stanislav Nikitin ace6d97a7a
continuous-integration/drone/push Build is passing Details
Remove xmlrpc package installation due to its absence.
2022-06-29 19:43:47 +05:00
configuration Switch to mirrorred images for Drone and Docker, update to PHP 8. 2022-06-29 19:39:30 +05:00
.drone.yml Switch to mirrorred images for Drone and Docker, update to PHP 8. 2022-06-29 19:39:30 +05:00
.gitlab-ci.yml Initial commit. 2021-07-12 11:24:52 +05:00
Dockerfile Remove xmlrpc package installation due to its absence. 2022-06-29 19:43:47 +05:00
README.md Update php to 7.4.26 and nginx to 1.20.2. 2021-11-19 18:42:22 +05:00

README.md

nginx, php, fpm

This container provides ability to use nginx with php-fpm for any PHP application.

Container was created as an attempt to move everything inside Docker, even things that isn't really dockerized for some reason.

Warning: this image isn't small and contains everything that is available in Alpine Linux for php. If you want to minimize image size - please build application-specific container!

Versions

At current commit image is using:

  • Alpine 3.14.0
  • nginx 1.20.2
  • php 7.4.26

Adding nginx configuration

Just bind files (or whole directory) to /etc/nginx/conf.d.

Adding php-fpm configuration

Just bind files (or whole directory) to /etc/php7/php-fpm.d with valid php-fpm configuration. Example:

[your-app]
user = nginx
group = nginx

listen = 127.0.0.1:9000

listen.owner = nginx
listen.group = nginx

listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 40
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 36
pm.process_idle_timeout = 10s;
pm.max_requests = 100

catch_workers_output = yes
access.log = /proc/self/fd/2

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

php_admin_value[memory_limit] = 128M

Notable things:

  • As nginx runs as user nginx, then php-fpm should also work using this user!