Learn by Directing AI
All materials

deployment-comparison.md

Deployment Comparison: Docker vs Platform Services

What Docker Gives You

Environment reproducibility. The container captures everything the application needs -- OS, runtime, dependencies, configuration. The same image runs on your laptop, your colleague's laptop, a staging server, and production. When something works in the container, you know it works everywhere the container runs.

Recovery speed. A container restarts in seconds. If the application crashes or the server reboots, docker start brings it back. No reinstalling dependencies, no reconfiguring environment variables, no wondering why production behaves differently from development.

Isolation. Each container runs in its own environment. Two applications on the same server can use different Node.js versions without conflicting. Updating one application's dependencies doesn't affect the other.

Same image everywhere. You build the image once. That exact image runs in development, staging, and production. No "well, it works on my machine" -- the image IS the machine.

What Vercel Gives You

Managed hosting. You push code and Vercel handles the server. No provisioning, no maintenance, no worrying about the underlying infrastructure. Vercel manages the operating system, the runtime, the networking, and the scaling.

SSL/TLS by default. Every deployment gets HTTPS automatically. No certificate management, no renewal. Just works.

CDN and edge network. Your application is served from data centres around the world. A user in Tokyo gets the site from a nearby server, not from your single Docker host.

Zero-config deployment. Connect your GitHub repo, push to main, and the new version is live in under a minute. No Dockerfile, no build command, no port mapping.

Automatic scaling. If traffic spikes -- say, during Annapurna season -- Vercel scales automatically. A single Docker container on a single server does not.

When to Use Which

There's no right answer. These are trade-off questions:

Do you need environment control? Vercel abstracts the environment -- you can't control the OS, the Node.js version, or the installed system libraries. Docker gives you full control. If your application needs a specific system library or a precise runtime version, Docker.

Do you need the same image in staging and production? Vercel builds separately for each environment. Docker guarantees the same image runs everywhere. If "staging passed but production broke" is a risk you can't accept, Docker.

Do you need managed infrastructure? Docker gives you a container. You still need a server to run it on, networking to connect it, monitoring to watch it. Vercel handles all of that. If you don't want to manage servers, Vercel.

What's your team's capacity? A solo developer or small team benefits from Vercel's simplicity. Docker requires understanding containers, networking, and infrastructure management. The trade-off is control vs effort.

What are the cost constraints? Vercel's free tier covers small projects. Docker requires a server (cloud VM, dedicated host, or your own hardware). At scale, the comparison shifts -- Vercel's per-request pricing vs fixed server costs.

Neither is better. They solve different problems. Many teams use both -- Docker for backend services that need environment control, Vercel for frontend applications that benefit from CDN and zero-config deployment.