← All notes

January 2026

Everything in one container: SPA, API and database

For a human-sized project, a single container serving the front, the API and talking to Postgres simplifies deployment without sacrificing much.

Not everything needs a distributed architecture. For a product run by a small team, bundling the static front and the API into one artifact reduces the operational surface.

Why a single container

Express serves the API and the static files of the already-built SPA. Postgres runs as a linked resource. One deployment, one image to version, one thing to monitor.

On a platform like Coolify, it comes down to a Dockerfile and a few environment variables. Rollback becomes trivial again: you repoint an image.

The limits to know

This model hits its limits when parts must scale independently, or when several teams touch the same artifact. Until then, distributing it prematurely costs more than it returns.

The right architecture matches the real size of the problem, not the one you anticipate.