Hi I'm running a basic react project with npm and I'm trying to start it in a docker container. However I can't actually get the project to run. My dockerfile looks like this:
FROM node:7.8.0
WORKDIR /
ADD . /
EXPOSE 80
RUN npm install
ENTRYPOINT npm run start
I get the relevant message saying that the project can now be viewed but in the browser nothing shows up. Any help would be appreciated.
Solved a similar issue by modifying npm start into package.json (line 6).
Try to add --host 0.0.0.0 after ng serve.
"start": "ng serve --host 0.0.0.0",
In last result, debug with curl http://localhost:6000
It might be called a websocket issue
I suspect that your ports might be backwards in your docker run
command. If you are running your react app on port 6000, and want to expose this to the outside on port 80, then you should run your container with ...
docker run -p 80:6000 myapp
Usage: docker run -p <HOST_PORT>:<CONTAINER_PORT> <APP_NAME>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With