SocketIO messages show up in local development but not in production

SocketIO messages show up in local development but not in production

I’ve using socket.io to emit messages in a chat app, it’s bootstrapped with Create React App and hosted in a docker file. I anticipated problems with the 2nd server (backend) in a single file, but I created a script concurzen that appears to run them both fine in local development. But when I build the image and run it in production the messages do not appear to be emitting. I’ve not used the build script, but I don’t think that should change how it’s running. Should I try to move it into a yaml swarm or docker-compose to launch the backend in a separate container?

localhost

docker run -v ${PWD}:/usr/src/app -v /usr/src/app/node_modules -p 3000:3000 -p 5000:5000 --rm turtlewolfe/chattain:dev

AWS

I’m dropping the volumes & remapping 3000 to 80… (everything else should be the same)

docker container run --detach --name Chattain --publish 80:3000 --publish 5000:5000 --restart=always turtlewolfe/chattain:dev

Live Demo

GitHub Repo

Have you set your AWS instance to specifically allow outbound communication on the required ports?

Is your emitter writing a log somewhere that you can actually verify the script is running?