DevOps Pipeline

Spider_Commerce — Containerized Deploy

A full-stack e-commerce platform containerized with Docker and shipped to Render. Multi-stage builds, Prisma + MongoDB, Cloudinary CDN for static asse...

Visit Project
Spider_Commerce — Containerized Deploy

Overview

Heads up: the backend runs on Render's free tier and sleeps after 15 min of inactivity. First request after a cold period may take 30-60s to wake it up; a keep-alive ping hits /api/health every 10 min to minimize this. Took an existing Next.js + Express + Prisma e-commerce app and rebuilt its deployment story from scratch: multi-stage Dockerfiles for frontend and backend, a per-Dockerfile .dockerignore scheme so one monorepo context cleanly builds two images, Cloudinary as the object store so image assets survive ephemeral filesystems, and a documented set of rules for shipping Docker on managed hosting (Render) after hitting every build-time pitfall (alpine vs musl, NODE_ENV=production dropping devDeps, lockfile drift, tsc including scripts). Terraform + LocalStack prototype sits alongside it for the full infra story — next up is pushing the Terraform layer to a real cloud.

Tech Stack

DockerDocker Multi-stageRenderNext.js 16ExpressPrisma 6MongoDB AtlasCloudinary CDN

Process

  • Wrote multi-stage Dockerfiles (builder + runner) for both frontend and backend using node:22-slim to avoid Alpine/musl pain with Prisma engines.
  • Fixed monorepo build context issues with per-Dockerfile .dockerignore files so one context builds two images cleanly.
  • Moved prisma + typescript to dependencies so Render's build-time NODE_ENV=production didn't strip them.
  • Migrated 38 product images and all static assets to Cloudinary so Render's ephemeral filesystem no longer wipes uploads on redeploy.
  • Wired a Next.js rewrite proxy (BACKEND_INTERNAL_URL) so the frontend fetches the backend over a single, consistent URL in dev and prod.
  • Documented the entire deploy as a reusable 'Docker on managed hosting' rules sheet for future projects.