Best Boilerplate with Docker: Enterprise Boilerplate vs Bedrock vs SaaSrock
Docker: From Dev to Production
Most SaaS boilerplates assume Vercel deployment — push to Git, Vercel builds and deploys. Simple, but limiting. What if you need to deploy to AWS, on-premises, or behind a corporate firewall?
Docker support means your SaaS runs anywhere a container runs — AWS ECS, Google Cloud Run, Azure Container Apps, Kubernetes, a $5 VPS, or your client's private cloud. It also means consistent development environments and reproducible builds.
Three boilerplates take Docker seriously: Enterprise Boilerplate (Next.js), Bedrock (Next.js), and SaaSrock (Remix). Each provides Dockerfiles, docker-compose configurations, and production deployment patterns.
TL;DR
Bedrock ($395-$995) has the most production-ready Docker setup — multi-stage builds, Docker Compose for development, CI/CD pipeline integration, and Kubernetes-ready configurations. Enterprise Boilerplate ($199-$499) includes Docker with optimized Next.js builds and health check endpoints. SaaSrock ($149-$699) provides Docker Compose for its Remix app plus all dependent services (database, Redis, email). Choose Bedrock for enterprise Docker/K8s. Choose SaaSrock for all-services-in-Docker development.
Key Takeaways
- Multi-stage Docker builds reduce image size from 1GB+ to 100-200 MB. All three implement this correctly.
- Docker Compose for development gives every developer the same environment — database, Redis, mail server included.
- CI/CD integration varies. Bedrock includes GitHub Actions for build/test/deploy. Enterprise Boilerplate includes build pipelines. SaaSrock has basic CI.
- Health check endpoints are critical for container orchestrators. Bedrock and Enterprise Boilerplate include them. SaaSrock requires manual setup.
- Most boilerplates ignore Docker entirely. ShipFast, Supastarter, Makerkit, T3 Stack — deploy to Vercel or figure it out yourself.
Docker Feature Comparison
| Feature | Enterprise Boilerplate | Bedrock | SaaSrock |
|---|---|---|---|
| Dockerfile | ✅ Multi-stage | ✅ Multi-stage | ✅ Multi-stage |
| Docker Compose (dev) | ✅ | ✅ | ✅ Full stack |
| Docker Compose (prod) | ✅ | ✅ | ⚠️ Basic |
| Image size | ~150 MB | ~120 MB | ~200 MB |
| Health check endpoint | ✅ /api/health | ✅ /health | ⚠️ Manual |
| Readiness probe | ✅ | ✅ | ❌ |
| Environment variables | ✅ Docker secrets | ✅ Docker secrets | ✅ .env file |
| PostgreSQL included | ✅ Compose | ✅ Compose | ✅ Compose |
| Redis included | ✅ Compose | ✅ Compose | ⚠️ Optional |
| CI/CD pipeline | ✅ GitHub Actions | ✅ GitHub Actions | ⚠️ Basic |
| K8s manifests | ❌ | ✅ | ❌ |
| Nginx/proxy config | ✅ | ✅ | ❌ |
| SSL/TLS config | ⚠️ Via proxy | ✅ | ❌ |
| Log management | ⚠️ stdout | ✅ Structured | ⚠️ stdout |
| Graceful shutdown | ✅ | ✅ | ⚠️ Basic |
Bedrock's Docker Setup
# Multi-stage build — production-optimized
FROM node:20-alpine AS base
RUN apk add --no-cache libc6-compat
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate
RUN pnpm build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
CMD ["node", "server.js"]
# docker-compose.yml — Development
services:
app:
build: .
ports: ["3000:3000"]
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/app
REDIS_URL: redis://redis:6379
depends_on:
db: { condition: service_healthy }
redis: { condition: service_started }
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: app
POSTGRES_PASSWORD: postgres
volumes: ["pgdata:/var/lib/postgresql/data"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
volumes: ["redis-data:/data"]
volumes:
pgdata:
redis-data:
Bedrock's setup includes health checks on the database, proper service dependencies, and volume persistence. The multi-stage build produces images under 120 MB.
When Docker Matters
You Need Docker If:
- Deploying to AWS/GCP/Azure — ECS, Cloud Run, AKS all use containers
- Enterprise customers require on-premises — Docker runs behind any firewall
- Team development consistency — everyone runs the same stack, same versions
- CI/CD pipeline — build once, deploy to staging and production
- Multiple services — database, Redis, background workers, main app
- Compliance requirements — reproducible, auditable builds
You Don't Need Docker If:
- Vercel/Netlify is sufficient — serverless deployment, no containers needed
- Solo developer — your local environment is the only environment
- Simple SaaS — single app, managed database, no background workers
When to Choose Each
Choose Bedrock If:
- Enterprise deployment — K8s manifests, health probes, structured logging
- Multi-environment pipelines — build → staging → production with the same image
- Compliance matters — auditable builds, Docker security scanning
Choose Enterprise Boilerplate If:
- Next.js + Docker — optimized standalone builds, health checks, CI/CD
- Moderate complexity — PostgreSQL + Redis + app in Docker Compose
Choose SaaSrock If:
- Remix + Docker — the only Remix boilerplate with proper Docker support
- Full development stack — database, email server, and app all containerized
Compare Docker support across 50+ boilerplates on StarterPick — filter by deployment options and infrastructure.
Check out this boilerplate
View Bedrock on StarterPick →