webdevops/php plus Nginx. Nginx serves /app and passes PHP requests to PHP-FPM in the same container.
8.2, 8.3, 8.4, 8.5 (Debian 12) and 8.2-alpine, 8.3-alpine, 8.4-alpine, 8.5-alpine, for both php-nginx and php-nginx-dev.
services:
app:
image: webdevops/php-nginx:8.5
ports:
- "8080:80"
environment:
WEB_DOCUMENT_ROOT: /app/public
volumes:
- ./:/appPorts: 80 (HTTP) and 443 (HTTPS). HTTPS uses a self-signed certificate for *.vm that every build of the image creates anew, valid for ten years. To use your own certificate, see Configuration files. Nginx listens on IPv4 and IPv6; if the container has no IPv6, it listens on IPv4 only. Your own configuration files with listen [::] are not changed, see Configuration files.
Started by default: nginx, php-fpm, cron, syslog. The -dev variant also starts postfix and ssh.
- Web server settings: Web server.
WEB_DOCUMENT_ROOT,WEB_DOCUMENT_INDEX,WEB_ALIAS_DOMAIN,WEB_PHP_TIMEOUTandSERVICE_NGINX_CLIENT_MAX_BODY_SIZEapply to Nginx. - PHP and PHP-FPM settings: see
webdevops/phpand Environment variables. - Scripts and hooks: Customization. Nginx's hook directory is
/opt/docker/bin/service.d/nginx.d.
php-nginx-dev is built on php-nginx and changes the following:
- Xdebug is loaded by default, as in
php-dev;PHP_DEBUGGERswitches to Blackfire or turns both off. To connect your IDE, see Xdebug with an IDE. opcache.revalidate_freqis0.- Postfix and an SSH server are started. Postfix sends mail to real recipients unless you set a relay host, see Mail. As in
php-dev,rootandapplicationhave the passworddev, also for SSH. - Files matching
WEB_NO_CACHE_PATTERN(CSS, JavaScript, images, JSON, XML by default) are served withexpires off.