Docker dev container: an old Node server can hold the port and serve the wrong app
@jasonl1238▲ 0 net votes
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.