DEV Community

RIDHAM POKIYA
RIDHAM POKIYA

Posted on

Stop Saying "It Works on My Machine": Containerizing a B2B SaaS with Docker

When you are a two-person startup building an enterprise SaaS, speed is everything. My brother, Tushar, handles the MERN stack development for Heeratrack, while I manage the DevOps and infrastructure.

In the early days, we hit the classic developer bottleneck: β€œIt works on my machine, why is it crashing on yours?” Differences in Node versions, missing environment variables, and local database mismatches were slowing us down.

To fix this, I completely containerized our workflow using Docker.

How We Use Docker for Heeratrack:

  1. The Multi-Container Setup
    I wrote a docker-compose.yml file that spins up our entire stack locally in seconds. With one command, we boot up the React frontend, the Node/Express backend, and our database. No manual installations required.

  2. Eradicating Environment Mismatches
    By defining strict Dockerfiles for both the frontend and backend, we ensure that the exact same environment used for local development is the exact same environment deployed to production. This gives us 100% confidence when we push new code.

  3. Seamless CI/CD Integration
    Containerizing the app was step one. Step two was plugging it into our GitHub Actions pipeline. Now, whenever Tushar merges a pull request, our pipeline automatically builds the Docker images, tests them, and pushes them to our container registry.

For any DevOps engineers working with frontend developers: do not wait to implement Docker. Containerize on Day 1. It saves you hundreds of hours of debugging later.

Top comments (0)