This project is a ready-to-use fullstack template that leverages Docker Compose to seamlessly integrate Nginx, React, FastAPI, and MariaDB. It provides a modern, production-like environment for rapid development and deployment of web applications with a clear separation between frontend and backend services.
- ⚛️ Frontend: Built with React, offering a fast and modern user interface.
- 🚀 Backend: Powered by FastAPI, with dependency management via uv (
pyproject.toml+uv.lock). - 🛢️ Database: Uses MariaDB for reliable and high-performance data storage.
- 🗄️ Database Management: phpMyAdmin provides an intuitive web-based interface for managing MariaDB databases.
- 🔀 Reverse Proxy: Nginx serves as a reverse proxy, efficiently routing traffic to the appropriate services.
- 📊 Log Management: Grafana provides log visualization and monitoring dashboards.
- 🐳 Dockerized: All services are containerized with Docker Compose for easy deployment.
- ⚙️ CI/CD Testing: Automated testing and generate coverage reporting with GitHub Actions.
git clone https://github.com/Lcwei-0708/docker-fullstack-template.gitcd docker-fullstack-templateCopy .env.example to .env, then edit as needed:
cp .env.example .envSet the
COMPOSE_FILEenvironment variable to switch between development and production modes.
First run or after code changes:
docker compose up -d --buildSubsequent runs (no code changes):
docker compose up -ddocker compose downOn first start, nginx/whitelist.conf is auto-created from whitelist.conf.example. Edit that file if you need to restrict allowed IP addresses.
To enable SSL (HTTPS), configure SSL settings in .env and place certificates in nginx/certs:
SSL_ENABLE=true
SSL_CERT_FILE=cert.pem
SSL_KEY_FILE=privkey.pemnginx/certs/
├── cert.pem # Your SSL certificate
└── privkey.pem # Your private keySee Nginx Docs for more details.
Run once if you want lint/format checks on commit. Requires uv and Node.js on the host.
./scripts/setup-pre-commit.shHooks auto-fix on commit: backend (Ruff format + lint fix), frontend (Prettier + ESLint fix), then re-stage if files changed.
Re-enable hooks:
pre-commit installDisable hooks before commit:
pre-commit uninstall| Directory | Link |
|---|---|
| Frontend | Docs |
| Backend | Docs |
| Nginx | Docs |
| CICD | Docs |
This project is licensed under the MIT License.