docker build -t api .
With my latop 0 problem, with docker curl: (56) Recv failure
Logs my service web Python : docker run --name api -p 8080:8080 api
Serving Flask app “server” (lazy loading)
Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
Debug mode: off
/usr/local/lib/python3.7/site-packages/flask_sqlalchemy/init.py:794: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and ’
Hi creaprog,
I have a very trivial question.
Are you overwriting the default flask port (5000) within server.py somehow?
If not, I think your issue might be related to the fact that you are mapping the wrong port number.
You should instead try -p 8080:5000
I hope it helps.
What happens when you try curling from within the container 5000?
If that works. My next worry would be to look for your machine firewall specs.
56 from curl means the connection was reset.
Do you have a running firewall? You might have to allow 8080.
Oh! Within the container? Interesting! This means that your flask server is not running (crashed) or that you are using a flask config that has overwritten the default port 5000 (may be 8080?). In case of a crash, may be try to attach to the running container and investigate that. Then try running the flask server yourself to see the reason of the crash. Otherwise investigate the appropriate internal port your server is running off and that may work for the mapping.
if I call the public ip via the browser I can access the docker but if I try with 0.0.0.0 or 127.0.0.1 I am getting the following error
curl: (56) Recv failure: Connection reset by peer