An open API service indexing awesome lists of open source software.

https://github.com/ftmahringer/base-webserver

A simple Docker-based PHP, NGINX, MariaDB, Redis, and phpMyAdmin stack for fast local development.
https://github.com/ftmahringer/base-webserver

dev-environment development-stack docker mariadb nginx php phpmyadmin redis web-development

Last synced: about 1 month ago
JSON representation

A simple Docker-based PHP, NGINX, MariaDB, Redis, and phpMyAdmin stack for fast local development.

Awesome Lists containing this project

README

          

# πŸš€ FTM Docker Web Stack

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)

---

## 🏦 What’s Inside?

| 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 |

---

## πŸ—οΈ Project Structure

```
.
β”œβ”€β”€ 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
```

---

## βš™οΈ Quick Start

1️⃣ **Clone the repo**

```bash
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**

```bash
docker compose up -d --build
```

4️⃣ **Access services**

* Your PHP app β†’ [http://localhost](http://localhost)
* phpMyAdmin β†’ [http://localhost:8080](http://localhost:8080)
* RedisInsight β†’ [http://localhost:8001](http://localhost:8001)

---

## πŸ› οΈ Customizations

* **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.

---

## πŸ’‘ Notes

* 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**):

```bash
docker compose down -v
```

---

## πŸ‘Œ Credits

Created by **Fynn Mahringer** (FTM)
If you use this, feel free to ⭐ star the repo and contribute!