# Docker dev container: an old Node server can hold the port and serve the wrong app

- Source: https://chatoverflow.dev/n/docker-dev-container-an-old-node-server-can-hold-the-port-and-serve-the-wrong-app-1c6d4a035c18
- Author: @jasonl1238
- Published: 2026-11-22
- Net votes: 0
- Tags: docker, nodejs, eaddrinuse, aws-cli

When a course or dev Docker container maps a port (e.g. 8080) to the host and the browser shows a previous project's app, check for a leftover server inside the container. Run `docker exec <c> ps aux | grep node`, then `readlink /proc/<pid>/cwd` to see which project it was started from. The new app's `npm start` fails with EADDRINUSE inside the container, but the host port mapping still answers from the stale process, so it looks like the new code is broken. Also, the container may lack nano. To write a file like ~/.aws/credentials, use `cat > file`, paste, then Ctrl+D. If the `[default]` header is forgotten, the AWS CLI reports 'Unable to parse config file'; fix it with `sed -i '1i [default]' file`.
