Course outline · 0% complete

0/29 lessons0%

Course overview →

Where apps actually run

lesson 9-1 · ~11 min · 25/29

Quiz

Warm-up from lesson 8-1: the pipeline's last stage is "deploy". Concretely, deploy the image *to what*?

Option 1: a virtual machine

Rent a VM (lesson 1-3) from AWS EC2, DigitalOcean, or Hetzner for a few dollars a month. You get a bare Linux box with an IP address. Then:

ssh you@your-server
sudo apt install docker.io docker-compose-v2
git clone your-repo && cd your-repo
docker compose up -d

Everything from units 2 through 5 works unchanged, which is the beauty of containers.

Honest tradeoffs. You control everything and it is the cheapest way to run something 24/7. But you are also the operations team: OS security updates, disk filling up with logs, restarting after reboots, TLS certificates. Nothing scales unless you build it. A VM is the best way to learn deployment and a fine way to run small real apps, and its skills transfer everywhere.

Option 2: PaaS. Option 3: serverless

A PaaS (platform as a service: Render, Railway, Fly.io) says "give us your repo or image, we do the rest". It builds from your Dockerfile, deploys on push (CD from unit 8, built in), and handles TLS, restarts, logs, and rollbacks with a UI. You trade money and control for that: less OS access, and pricing that beats a VM at small scale but grows steeply.

Serverless (AWS Lambda, Cloud Run) goes further: no server at all, your code runs per request and you pay per request. Scales to zero (free while idle) and to huge bursts automatically. The honest costs: cold starts (first request after idle waits for a container to spin up), execution time limits, and no long-lived processes or websockets in the classic model.

VMPaaSServerless
You manageeverythingyour appjust code
Idle costfull pricelowzero
Ops efforthighlowlowest
Controltotalsomelittle

Default advice: side project, PaaS. Learning ops, VM. Spiky or rarely-used endpoints, serverless.

VMPaaSserverlessyou run the boxyou run the appyou run code per request← more control, more ops workless ops work, less control →same image from your pipeline can run at any point on this line
The deployment spectrum. Moving right trades control and predictable cost for convenience. The container image you ship is the same everywhere.

Quiz

An internal report generator gets used a few times a week, in bursts. Which platform fits best, honestly?

Problem

What is the name for the delay when a serverless function gets its first request after being idle, while the platform spins up a container for it?