cloudmesh / cloudmesh-openapi

Other
8 stars 3 forks source link

Docker Network Setup #15

Closed prateekazam closed 4 years ago

prateekazam commented 4 years ago
laszewsk commented 4 years ago

This is rejected

flask should start on 127.0.0.1 as the 0.0.0.0 would open to all of the internet and be a potential security risk during development.

if you need to use docker you need to do it in such a way that the ports are not exposed.

laszewsk commented 4 years ago

docker run -i --expose=5000 ... docker run -d -p 5000:5000 ...

prateekazam commented 4 years ago

docker run -it -p 8080:8080 openapi3 , i am using this command. Since in container flask server is running on the localhost. I cannot able to access it from outside. Port routing is working fine. But when I start flask sever to 0.0.0.0 , i am able to access.

prateekazam commented 4 years ago

I have read from https://docs.docker.com/network/host/ , and they have suggested running docker like docker run -it --network="host" -p 8080:8080 openapi3 bash The above command is working, Is this fine? But in this case, the container did not get any IP address.