This project sets up a modern PHP development environment using Docker, including:
✅ NGINX (web server)
✅ PHP-FPM (with custom php.ini
)
✅ MariaDB (MySQL-compatible database)
✅ phpMyAdmin (database web UI)
✅ Redis (caching)
✅ RedisInsight (visual Redis browser)
Service | Description |
---|---|
NGINX | Lightweight web server with custom config |
PHP-FPM | FastCGI PHP engine with tuned PHP settings |
MariaDB | MySQL-compatible database for development |
phpMyAdmin | Web interface to manage MariaDB |
Redis | Fast in-memory key-value store |
RedisInsight | UI to explore and debug Redis data |
.
├── app/ → Your PHP project code goes here
├── docker/
│ ├── nginx/
│ │ └── nginx.conf → Custom NGINX configuration
│ ├── php/
│ │ ├── Dockerfile → Custom PHP build (with extensions/settings)
│ │ └── php.ini → Custom PHP settings
├── docker-compose.yml → Orchestrates all services
└── .env → Environment variables for the stack
1️⃣ Clone the repo
git clone https://github.com/FTMahringer/Base-Webserver.git
cd BASE-Webserver
2️⃣ Create your .env
Already provided, but adjust as needed:
MYSQL_ROOT_PASSWORD=rootpassword
MYSQL_DATABASE=dbname
MYSQL_USER=user
MYSQL_PASSWORD=password
PMA_HOST=mariadb
3️⃣ Start the stack
docker compose up -d --build
4️⃣ Access services
- Your PHP app → http://localhost
- phpMyAdmin → http://localhost:8080
- RedisInsight → http://localhost:8001
- Nginx config →
docker/nginx/nginx.conf
- PHP settings →
docker/php/php.ini
- Dockerfile for PHP →
docker/php/Dockerfile
You can modify these to fit your project’s needs.
- Database data persists in the
mariadb_data
volume. - Redis data persists in the
redis_data
volume. - NGINX logs are saved in the
nginx_logs
volume.
To clear everything (⚠ will delete all data):
docker compose down -v
Created by Fynn Mahringer (FTM) If you use this, feel free to ⭐ star the repo and contribute!