Containers package processes and their connections
Taskboard needs an API process, a worker, Postgres, and local email capture. Docker packages each service so the host does not need separate manual installations of every runtime.
An image is the packaged filesystem and startup configuration. A container is a running instance of an image. API and worker containers can use the same image while choosing different commands.
Read the process layout
The Dockerfile compiles TypeScript in a build stage. The runtime stage copies compiled code and runtime dependencies, then runs as the node user. Compose starts that image as the API and overrides its command for the worker.
worker:
image: taskboard-api:local
command: ["node", "dist/worker-main.js"]
Postgres has a named volume. Container replacement does not mean database deletion because the volume stores the database files separately. Removing that volume can destroy the local data. A volume is persistence, not a backup.
The service hostname postgres resolves on the Compose network. Inside the API container, localhost refers to the API container itself. The database URL therefore uses postgres, while a host-side client connects through the published loopback port.
Startup needs evidence
Compose first waits for Postgres health, then runs the migration service. API and worker depend on successful migration completion. Starting a container does not prove that the service inside it is ready. Compose supports health and completion conditions for dependencies. Compose startup ordering.
Mailpit accepts local SMTP and displays captured messages on its web interface. It lets verification inspect real message submission without sending to public inboxes.
The provided Compose file uses local-only credentials and development settings. An image can be reusable while the local configuration remains unsuitable for public deployment. Production supplies secrets, HTTPS routing, storage policy, and observability through its hosting environment.
This course's static build is separate. Docusaurus becomes files that Cloudflare Pages can serve. The API and worker remain running processes and need suitable runtime hosting.
Read the build in Read Dockerfile and services in Read compose.yml.
An image packages code; Compose connects processes. Health checks, migration ordering, and persistent storage still need explicit configuration.
Does rebuilding the API image erase Postgres data?
No, not while the named Postgres volume remains attached. Deleting or replacing the volume is a separate action with a different data consequence.