Skip to content

adityarizqi/Docker-PostgreSQL-Redis-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Database Services Boilerplate

This repository provides a ready-to-use Docker Compose setup for common database and monitoring needs. It bundles persistent PostgreSQL and Redis services, automated backups via SQLBak, and a full Prometheus monitoring stack with cAdvisor and exporters. Use it as a starting point for local development or small deployments. Grafana Cloud Image

Services

  • PostgreSQL – Primary relational database with persistent volume and credentials supplied through environment variables.
  • Redis – In-memory key‑value store configured with password protection and persistent volume.
  • SQLBak – Automated backup service that uploads database dumps to external storage using your SQLBak account key.
  • Prometheus – Monitoring server that scrapes metrics from exporters and stores them on a dedicated volume.
  • PostgreSQL Exporter and Redis Exporter – Expose database metrics for Prometheus.
  • Node Exporter – Collects host machine metrics.
  • cAdvisor – Container resource monitoring, also scraped by Prometheus.

Getting Started

  1. Copy the example environment file and adjust credentials:

    cp .env.example .env
    # Edit .env with your preferred usernames, passwords and SQLBak token

    If you don't have a SQLBak token yet, sign up for a free account at https://sqlbak.com to generate one.

  2. Launch the stack:

    docker compose up -d
  3. Access services:

Additional Docs

License

This project is released under the MIT License.

About

This repository provides a ready-to-use Docker Compose setup for common database and monitoring needs. It bundles persistent PostgreSQL and Redis services, automated backups via SQLBak, and a full Prometheus monitoring stack with cAdvisor and exporters. Use it as a starting point for local development or small deployments.

Resources

License

Stars

Watchers

Forks

Contributors