Containers: Docker, Compose and Swarm

Intermediate

Development and production

The team develops with docker compose up: the code is mounted for live reload and the Node.js debugger listens on port 9229. Production runs docker compose -f compose.yaml -f compose.prod.yaml up -d... and gets the same mount and the open debugger. Make production clean without breaking the developers' setup.

The test runs the production command, checks the running containers for bind mounts, published debug ports and development mode, and calls /health. At the end it runs docker compose up -d alone to check that development still reloads the code.

What your server must hold

  • No bind mount in production
  • No debug port published
  • No container in development mode
  • Availability ≥ 99 %
  • Live reload works in development bonus

What you will master