Sign inSign up

z8bulon/nginx.php-fpm

By z8bulon

•Updated about 4 years ago

NGINX 1.23.x with buildin php7.4-fpm

Image
0

10K+

z8bulon/nginx.php-fpm repository overview

⁠NGINX with PHP-FPM and Goaccess

Base image from openSUSE/leap. NGINX and Goaccess build from source. PHP-FPM from `openSUSE default packages (php7-fpm 7.4.32).

⁠Where to place your virtual host config file:

A default container startup would include the test site vhost1.site. You would place your own virtual host config file in /etc/nginx/sites-enabled. See the default vhost1.conf example here:⁠

⁠Where to place you virtual host files:

The default localhost map is /srv/www/htdocs/html. You should not need to change this as it is used for the healthcheck and basic test of the webserver.
Your put your own site into /srv/www/htdocs/your-vhost. The default container vhost1.site is located at /srv/www/htdocs/vhost1.

⁠Example to test the container in default setting

docker container run -d -p 80:80 -p 443:443 --name nginx z8bulon/nginx.php-fpm
Browse to http://localhost to test the default index.html file.
Browse to http://localhost/info.php to test php-fpm.
Browse to https://vhost1.site to test HTTPS, index.php will show phpinfo.

⁠Example to run the container and pass one of the available ENV (see below).

docker container run -d -p 80:80 -p 443:443 --name nginx -e PHP.date.timezone='Europe/Paris' z8bulon/nginx.php-fpm

⁠ENV var available and their defaults:

PHP.zlib.output_compression=On
PHP.zlib.output_compression_level=4
PHP.max_input_time=60
PHP.memory_limit=128M
PHP.error_reporting='E_ALL & ~E_DEPRECATED & ~E_STRICT'
PHP.display_errors=Off
PHP.display_startup_errors=Off
PHP.log_errors=On
PHP.log_errors_max_len=1024
PHP.ignore_repeated_errors=Off
PHP.ignore_repeated_source=Off
PHP.report_memleaks=On
PHP.post_max_size=48M
PHP.default_charset='UTF-8'
PHP.file_uploads=On
PHP.upload_max_filesize=16M
PHP.max_file_uploads=20
PHP.allow_url_fopen=On
PHP.allow_url_include=Off
PHP.default_socket_timeout=60
PHP.date.timezone='Europe/Amsterdam'
PHP.SMTP=localhost
PHP.smtp_port=587
PHP.mail.add_x_header=Off
PHP.opcache.enable=1
PHP.opcache.validate_timestamps=1
PHP.opcache.max_accelerated_files=10000
PHP.opcache.memory_consumption=512
PHP.opcache.interned_strings_buffer=16
PHP.session.save_handler=files
PHP.session.save_path = "/var/lib/php7"
PHP.session.gc_probability=1
PHP.session.gc_divisor=1000
FPM.pid=/run/php-fpm.pid
FPM.error_log=/dev/stderr
FPM.log_level=warning
FPM.emergency_restart_threshold=10
FPM.emergency_restart_interval=1m
FPM.process_control_timeout=10s
WWW.user=nginx
WWW.group=nginx
WWW.listen=/run/php-fpm.sock
WWW.listen.owner=nginx
WWW.listen.group=nginx
WWW.listen.mode=0660
WWW.listen.allowed_clients=127.0.0.1
WWW.pm=dynamic (the other options are static and ondemand)
WWW.pm.max_children=10 (only used when FPM.pm=static or FPM.pm=dynamic)
WWW.pm.start_servers=2 (only used when FPM.pm=dynamic)
WWW.pm.min_spare_servers=2 (only used when FPM.pm=dynamic)
WWW.pm.max_spare_servers=3 (only used when FPM.pm=dynamic)
WWW.pm.process_idle_timeout=60s (only used when FPM.pm=ondemand)
WWW.pm.max_requests=200 \

⁠Installed PHP7 packages:

php7-fpm php7-APCu php7-gd php7-intl php7-mbstring php7-memcached php7-mysql php7-opcache php7-tidy php7-xmlrpc php7-xsl php7-zip php7-zlib php7-bz2 php7-curl php7-fastcgi php7-json

⁠Permissions:

NGINX and PHP-FPM user and group is nginx, uid 101 (nginx) gid 101 (nginx) groups 100 (users).

⁠NGINX source configuration:

--prefix=/srv/www/nginx --sbin-path=/usr/sbin/nginx --modules-path=/etc/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/srv/www/nginx/tmp/ --http-proxy-temp-path=/srv/www/nginx/proxy/ --http-fastcgi-temp-path=/srv/www/nginx/fastcgi/ --http-uwsgi-temp-path=/srv/www/nginx/uwsgi/ --http-scgi-temp-path=/srv/www/nginx/scgi/ --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --with-http_ssl_module --with-http_v2_module --with-pcre --with-ipv6 --with-http_xslt_module --with-http_image_filter_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-openssl=/tmp/openssl-OpenSSL_1_1_1h

⁠Included in the image:

Siege is a multi-threaded http load testing and benchmarking utility. See the man page here:⁠
apache2-utils provided by the Apache 2 Web Server project which are useful to administrators of web servers in general. See more info here:⁠
Example: ab is a tool for benchmarking your Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current HTTP server installation performs. This especially shows you how many requests per second your Apache installation is capable of serving. See the man page here:⁠
Also included is curl, iputils, openssl and nano.

Tag summary

Content type

Image

Digest

sha256:b675a795a…

Size

176.7 MB

Last updated

about 4 years ago

docker pull z8bulon/nginx.php-fpm