Can't open react app in code-server while running on docker container. #5488
-
I tried running code-server in windows, so I used docker command.
After that I tried creating an react app using npx create-react-app myapp. After creating the app, I issue npm start to start the app.Till now everything was fine, but I am not able to see the application on localhost:3000. It is obvious that the localhost is not seen outside container. Also I searched for docker networking and found if I put --network="host" it will in case of Linux, but not on windows and Mac. So, here is my question, how will I use same host network feature in windows without any proxy like 3000-mydomain-proxy. I want to run my react on particular ip address. Kindly suggest solution. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hmm....so outside a docker container, localhost works so localhost:3000 works, which we know. Do you need an additional I found this: docker run -p 2000-5000:2000-5000 -v /host/:/host appimage to expose a range of ports. cc @code-asher in case you know other solutions |
Beta Was this translation helpful? Give feedback.
Hmm....so outside a docker container, localhost works so localhost:3000 works, which we know.
Do you need an additional
-p 127.0.0.1:3000:3000
in therun
command? But then if you change the port, you'd have to kill the container not ideal.I found this:
to expose a range of ports.
cc @code-asher in case you know other solutions