A lightweight, high-performance Docker image that combines PHP 8.4 with a Go HTTP server
597
A lightweight, high-performance Docker image that combines PHP 8.4 (compiled from source) with a Go HTTP server. Perfect for modern PHP applications with intelligent framework routing and enhanced security.
# Run with default application
docker run -p 8080:80 teguh02/gophp:latest
# Mount your PHP project
docker run -p 8080:80 -v /path/to/your/project:/app teguh02/gophp:latest
Visit: http://localhost:8080
# Mount WordPress project
docker run -p 8080:80 -v /path/to/wordpress:/app teguh02/gophp:latest
# Features:
# - Pretty permalinks support
# - wp-admin, wp-content routing
# - Plugin/theme compatibility
# Mount Laravel project (public folder auto-detected)
docker run -p 8080:80 -v /path/to/laravel:/app teguh02/gophp:latest
# Features:
# - Clean URLs without index.php
# - public/ directory support
# - Route caching compatibility
# Mount CodeIgniter project
docker run -p 8080:80 -v /path/to/codeigniter:/app teguh02/gophp:latest
# Features:
# - Controller/method routing
# - Clean URLs support
# - Assets serving optimization
.env - Environment configuration.git/ - Git repository filescomposer.json, composer.lock - Dependency filespackage.json, package-lock.json - Node.js files.htaccess - Apache configurationwp-config.php - WordPress config (when accessed directly)*.bak, *.tmp, *.log).DS_Store, Thumbs.db)# Automatic cache headers
CSS/JS files: Cache-Control: public, max-age=86400 (1 day)
Images: Cache-Control: public, max-age=604800 (7 days)
Fonts: Cache-Control: public, max-age=2592000 (30 days)
Other static: Cache-Control: public, max-age=3600 (1 hour)
# No environment variables required - auto-detection works out of the box
# Framework detection happens automatically based on project files
# Mount custom php.ini
docker run -p 8080:80 \
-v /path/to/project:/app \
-v /path/to/custom.ini:/usr/local/php/etc/php.ini \
teguh02/gophp:latest
Built-in health endpoint for monitoring:
curl http://localhost:8080/health
Response:
{
"status": "healthy",
"service": "gophp",
"timestamp": 1694395200
}
# Quick development setup
docker run --rm -p 8080:80 -v $(pwd):/app teguh02/gophp:latest
# docker-compose.yml
version: '3.8'
services:
web:
image: teguh02/gophp:latest
ports:
- "80:80"
volumes:
- ./app:/app
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
# Full stack with MySQL
version: '3.8'
services:
web:
image: teguh02/gophp:latest
ports:
- "80:80"
volumes:
- ./app:/app
depends_on:
- mysql
restart: unless-stopped
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: yourpassword
MYSQL_DATABASE: yourapp
volumes:
- mysql_data:/var/lib/mysql
restart: unless-stopped
volumes:
mysql_data:
Internal Server Error on PHP files:
# Check container logs
docker logs <container_name>
# Verify PHP-CGI is working
docker exec <container_name> php-cgi -v
File permissions:
# Ensure files are readable
chmod -R 755 /path/to/your/project
Framework not detected:
# Check for framework files
# WordPress: wp-config.php
# Laravel: artisan file
# CodeIgniter: system/ directory
| Metric | Value |
|---|---|
| Image Size | ~80MB |
| Cold Start | ~2s |
| Memory Usage | ~50MB (base) |
| Static File Serving | Direct (no PHP overhead) |
| Framework Detection | Automatic |
This image replaces traditional web servers:
# Instead of nginx + php-fpm
docker run nginx:alpine # ❌ Complex setup
# Use GoPHP directly
docker run teguh02/gophp:latest # ✅ Simple & fast
# Host multiple PHP apps
docker run -p 8080:80 -v /var/www/site1:/app teguh02/gophp:latest
docker run -p 8081:80 -v /var/www/site2:/app teguh02/gophp:latest
Found a bug or want to contribute?
This project is licensed under the MIT License.
⭐ If this image helps your project, please consider giving it a star!
Content type
Image
Digest
sha256:f3b19e2d0…
Size
35.7 MB
Last updated
about 1 year ago
docker pull teguh02/gophp