DEV Community

MapDevops
MapDevops

Posted on

Stop Wasting 10+ Hours Setting Up Docker for Every New Project

You know the drill.

New project. New repo. Now spend the next 10–15 hours writing Dockerfiles, configuring Nginx, wiring up docker-compose, setting up health checks, adding a CI pipeline, figuring out monitoring...

And you haven't written a single line of business logic yet.

I've done this setup dozens of times across freelance gigs, side projects, and production systems. So I packaged the result into ready-to-use Docker boilerplates that let you skip straight to building features.

What's Inside Each Boilerplate

Every boilerplate is a complete, standalone project you unzip and run. No frameworks to learn, no CLI tools to install. Just Docker.

Here's what you get out of the box:

  • Multi-stage Dockerfiles — optimized images, non-root users, layer caching
  • docker-compose.yml — all services wired together with health checks
  • Monitoring stack — Prometheus + Grafana pre-configured
  • GitHub Actions CI — test + build pipeline ready to go
  • Makefilemake up, make down, make logs, make test
  • Environment management.env.example with sensible defaults
  • Security hardened — Helmet, CORS, non-root containers, no source in prod images

3 Stacks Available

1. React + Express + PostgreSQL

The classic. Battle-tested stack used by thousands of production apps.

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   React      │────▶│   Express    │────▶│  PostgreSQL  │
│  (Nginx:80)  │     │    (:3000)   │     │   (:5432)    │
└──────────────┘     └──────────────┘     └──────────────┘
Enter fullscreen mode Exit fullscreen mode
  • Frontend: React 18 + Vite → built and served by Nginx
  • Backend: Express.js with health endpoints and pg driver
  • Database: PostgreSQL 16 with init script and seed data

Best for: REST APIs, CRUD apps, SaaS MVPs, any project where you want full control over frontend and backend separately.

2. React + Express + MongoDB

Same frontend and backend architecture, swapped to a document database.

  • Frontend: React 18 + Vite → built and served by Nginx
  • Backend: Express.js + Mongoose with health endpoints
  • Database: MongoDB 7 with init script

Best for: apps with flexible schemas, content platforms, prototypes where you don't want to think about migrations.

3. Next.js + PostgreSQL

Modern fullstack in a single container. No separate backend, no Nginx.

┌──────────────┐     ┌──────────────┐
│   Next.js    │────▶│  PostgreSQL  │
│  App (:3000) │     │   (:5432)    │
└──────────────┘     └──────────────┘
Enter fullscreen mode Exit fullscreen mode
  • App: Next.js 14 with standalone output, API routes for /health
  • Database: PostgreSQL 16 with init script and seed data

Best for: fullstack apps, server-rendered pages, projects where you want one deployment unit.

How It Works

# 1. Unzip
unzip react-express-postgres.zip -d my-project
cd my-project

# 2. Configure
cp .env.example .env

# 3. Run
make up

# 4. Verify
curl http://localhost:3000/health
# → {"status":"ok"}
Enter fullscreen mode Exit fullscreen mode

That's it. All services running, health checks passing, monitoring available at localhost:9090 (Prometheus) and localhost:3001 (Grafana).

Monitoring Included

Every boilerplate ships with a Prometheus + Grafana stack:

docker compose -f docker-compose.yml -f monitoring/docker-compose.monitoring.yml up -d
Enter fullscreen mode Exit fullscreen mode

No extra config needed. Prometheus scrapes your backend health endpoint. Grafana connects to Prometheus automatically. Default login: admin/admin.

The CI Pipeline

Each boilerplate includes a .github/workflows/ci.yml that:

  1. Tests — installs deps, runs npm test for each service
  2. Builds — builds Docker images to verify they compile

Push to GitHub and your pipeline is already green.

Project Structure

Clean, predictable, no surprises:

my-project/
├── backend/          # Express API (or app/ for Next.js)
│   ├── Dockerfile
│   ├── package.json
│   └── src/
├── frontend/         # React + Vite (not in Next.js variant)
│   ├── Dockerfile
│   ├── package.json
│   └── src/
├── db/               # Init script (SQL or JS)
├── monitoring/       # Prometheus + Grafana
├── .github/workflows/ci.yml
├── docker-compose.yml
├── Makefile
├── .env.example
└── README.md
Enter fullscreen mode Exit fullscreen mode

Who Is This For?

  • Freelancers who start new client projects every month and are tired of copy-pasting Docker configs
  • Indie hackers who want to ship an MVP this weekend, not next month
  • Junior developers who want to learn Docker with a real, working setup instead of toy examples
  • Teams who need a consistent starting point across projects

What You're NOT Getting

This is not a framework. There's no vendor lock-in, no CLI, no magic.

You get plain files — Dockerfiles, compose files, JavaScript, SQL. Read them, modify them, own them. If you know Docker basics, you'll understand everything in 10 minutes.

Get Started

👉 ReactJS + Express + Postgresql stack — $29
👉 ReactJS + Express + Mongo stack — $29
👉 Next.JS + Postgresql stack — $29

👉 All 3 stacks bundle — $49 (save 40%)

Each purchase includes all future updates. Unzip, run, and start building what actually matters — your product.

Top comments (0)