Closed prateekazam closed 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.
docker run -i --expose=5000 ... docker run -d -p 5000:5000 ...
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.
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.