BookNest runs as three services on one Compose 514 network. web is Nginx 75 : it serves the static front end from public/ and forwards /api/ requests to the API, so the browser sees a single origin and needs no CORS. api is the Node.js 2,131 image of Multi-Stage and BuildKit. db is PostgreSQL 18 1,289 with its data in the pgdata volume. Only web must face users; the API's port stays published for development, and the database's is loopback-only.

Each service has one job and its own image, so each is rebuilt, scaled and scanned on its own. Nginx serves files and buffers slow clients more cheaply than Node.js; the API keeps express.static for its tests and for running without Nginx.