Docker

Docker packs a program together with everything it needs and starts it in a box. The box — a container — is not a small computer. It is an ordinary program running on this machine, but inside a walled garden: its own view of the files, its own network, its own ceiling on memory. The idea is older than Docker; Docker made those packages practical to build and share.

A package, called an image, is a stack of layers, each one a change on top of the last. That is why the order of the recipe file matters: list the dependencies first and your own code last, and editing the code rebuilds only the top layer. It is also why the exact tag on a base image belongs in your list of things to pin — node:24-alpine and node:alpine are different amounts of risk.

One program per box is the rule that keeps this honest. A box that secretly runs four programs hides which one failed and turns the log into soup. Several boxes, each with a single job, plus a short file describing how they are wired: that is the shape used here.

That description is where the thinking happens. This machine carries two stacks — one for the infrastructure, one for the site — so restarting one does not disturb the other. The networks are named rather than assumed: the database sits on a network with no exit to the internet, the admin panel stands on two, the doorkeeper on the one the outside can reach. A health check decides the order, so the admin panel waits for the database instead of crashing into it.

The traps are invisible in that file. Being allowed to run Docker is the same as being allowed to run anything as an administrator, because the service will do as it is told. A published port bypasses the firewall, because Docker writes its own forwarding rules ahead of it. A single file mounted in from outside goes stale when an editor replaces it, since the box keeps reading the file that was there when it started. And a box can be thrown away while its data stays behind — a feature right up to the moment you run the command that deletes the data too.