python - Docker connection refused on all ports except 5000 -
i have started docker. have installed docker toolbox windows. trying out sample flask app understand how things work. stuck!. trying access app http://docker-machine-ip : port number
every time do, '{docker-machine ip} refused connect.'
i no exceptions during building , deploying stages. did docker ps
see container running. tried access via kitematic still no luck. below details related app
app.py
from flask import flask app = flask(__name__) @app.route("/") def hello(): return "flask inside docker shakel!!" if __name__ == "__main__": app.run(debug=true,host='0.0.0.0')
requirements.txt
flask
dockerfile
from python:2.7 maintainer shekhar gulati "shekhargulati84@gmail.com" copy . /app workdir /app run pip install -r requirements.txt entrypoint ["python"] cmd ["app.py"]
the docker commands used building , running are:
docker-machine ip default //to docker machine ip docker build -t flask-app . docker run -d -p 6000:6000 flask-app
i have windows 7 64 bit. please let me know if more info required.
p.s. however noticed if map container 5000 port run fine on other port connection refused
i don't know missing here. first attempt @ docker , have googled 4 hrs find solution nothing working. might dumb mistake doing somewhere :).anyhow appreciated. in advance.
that's because didn't set port flask application, port 5000
default.
from flask documentation:
port – port of webserver. defaults 5000 or port defined in server_name config variable if present.
Comments
Post a Comment