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-Webserver2οΈβ£ 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 --build4οΈβ£ 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_datavolume. - Redis data persists in the
redis_datavolume. - NGINX logs are saved in the
nginx_logsvolume.
To clear everything (β will delete all data):
docker compose down -vCreated by Fynn Mahringer (FTM) If you use this, feel free to β star the repo and contribute!