Skip to content

A ready-to-use fullstack Docker template combining Nginx, React, FastAPI, and MariaDB for modern web application development.

License

Notifications You must be signed in to change notification settings

Lcwei-0708/docker-fullstack-template

Repository files navigation

Testing Coverage

Docker Fullstack Template

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.

Features

  • ⚛️ Frontend: Built with React, offering a fast and modern user interface.
  • 🚀 Backend: Powered by FastAPI, providing a robust and flexible API layer.
  • 🛢️ 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.

How to Use

1. Clone the repository

git clone https://github.com/Lcwei-0708/docker-fullstack-template.git

2. Move to project

cd docker-fullstack-template

3. Configure environment variables

If you want to customize settings, copy .env.example to .env and edit as needed.

Set the COMPOSE_FILE environment variable to switch between development and production modes.

4. Set up Nginx IP whitelist and SSL certificates

 If you need to restrict the range of allowed IP addresses, edit this file.
  • To enable SSL (HTTPS), you need to configure SSL settings in your .env file and place your SSL certificates in the nginx/ssl directory.
    • Env setting:

      SSL_ENABLE=true
      SSL_CERT_FILE=cert.pem
      SSL_KEY_FILE=privkey.pem
    • Place your certificates in the nginx/ssl directory:

      nginx/ssl/
      ├── cert.pem       # Your SSL certificate
      └── privkey.pem    # Your private key

See Nginx Docs for more details.

5. Start the services

First run or after code changes:

docker compose up -d --build

Subsequent runs (no code changes):

docker compose up -d

6. Stop the services

docker compose down

Documentation

Directory Link
Frontend Docs
Backend Docs
Nginx Docs
CICD Docs

License

This project is licensed under the MIT License.

About

A ready-to-use fullstack Docker template combining Nginx, React, FastAPI, and MariaDB for modern web application development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published