Interview Prep/Docker/Containers that exit, crash or misbehave

App crashes with `Error: listen EADDRINUSE: address already in use :::3000` inside the container.

BeginnerTroubleshootingContainers that exit, crash or misbehave
Answer

Likely causes → Two processes in the container on the same port (e.g. nodemon plus a second start), or a restarted process before the old one released the port.

Diagnose → docker exec c ss -tlnp (or netstat), docker top c.

Fix → Run a single process, fix the dev script, use --init to reap.

Prevent → One process per container.

All Docker questions Roadmap: Docker & containers

More on Containers that exit, crash or misbehave