6dtools PHP-FPM Nginx Docker Image
Overview
A lightweight, production-ready Docker image combining PHP 8.5-FPM with Nginx on Alpine Linux, optimized for high-performance web applications. This image is designed and maintained by 6dtools for modern PHP development and deployment.
Features
Core Components
PHP 8.5-FPM : Latest PHP version with FastCGI Process Manager
Nginx : High-performance web server with latest stable version
Alpine Linux : Minimal base image for reduced size and improved security
PHP Extensions
mysqli : MySQL database connectivity
curl : HTTP client functionality
zip : ZIP archive support
openssl : Secure SSL/TLS communications
libxml2 : XML processing capabilities
Security & Performance
Alpine Edge repositories for latest package updates
Non-root user execution (UID 1001)
Optimized file permissions
Clean package cache for minimal image size
Architecture
Directory Structure
/6dapps/
├── app/ # Application files
│ └── run.sh # Main startup script
└── logs/ # Log storage
/var/www/html/ # Web root directory
/var/log/nginx/ # Nginx logs
/var/cache/nginx/ # Nginx cache
Copy
Configuration Files
nginx.conf : Main Nginx configuration
default.conf : Default virtual host configuration
www.conf : PHP-FPM pool configuration
custom.ini : Custom PHP settings
nginx-entrypoint.sh : Container initialization script
Usage
Building the Image
docker build -t 6dtools/php-fpm-nginx:8.5-alpine .
Copy
Running the Container
docker run -d \
--name php-nginx-app \
-p 33380:33380 \
-v /path/to/app:/var/www/html \
6dtools/php-fpm-nginx:8.5-alpine
Copy
Docker Compose Example
version: '3.8'
services:
web:
build: .
ports:
- "33380:33380"
volumes:
- ./app:/var/www/html
- ./logs:/6dapps/logs
restart: unless-stopped
Copy
Port Configuration
33380 : Default exposed port for web traffic
Environment & Customization
Custom PHP Configuration
Mount your custom PHP ini file to /usr/local/etc/php/conf.d/custom.ini
Custom Nginx Configuration
Mount custom configurations to:
/etc/nginx/nginx.conf
/etc/nginx/http.d/default.conf
Volume Mounts
Application Code : /var/www/html
Logs : /6dapps/logs
Nginx Logs : /var/log/nginx
Security Considerations
Runs as non-root user (UID 1001)
Minimal Alpine base reduces attack surface
Regular package updates via Alpine Edge repositories
Proper file permissions set for web directories
Performance Optimizations
PHP-FPM process manager for optimal PHP performance
Nginx caching enabled
Alpine Linux for minimal resource usage
Optimized file permissions for web serving
Support
This image is maintained by 6dtools. For issues or support requests, please refer to the project documentation or contact the 6dtools team.
License
Please refer to the project's license file for usage terms and conditions.