Run Heroku Container
I have pushed the docker image with flask and other libraries. It was working fine in local container.
In the flask it is app.run(), earlier we were specifying port 5000 as well.
I deployed the stack to heroku and it is successful. but when I try to test it in the browser by typing predictpy.heroku.com:5000
is erroring out:
Port 5000
I am trying
predictpy.heroku.com
refused to connect.
Any idea? Am I missing something when deploying the flask application to Heroku?
docker heroku flask containers
add a comment |
I have pushed the docker image with flask and other libraries. It was working fine in local container.
In the flask it is app.run(), earlier we were specifying port 5000 as well.
I deployed the stack to heroku and it is successful. but when I try to test it in the browser by typing predictpy.heroku.com:5000
is erroring out:
Port 5000
I am trying
predictpy.heroku.com
refused to connect.
Any idea? Am I missing something when deploying the flask application to Heroku?
docker heroku flask containers
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23
add a comment |
I have pushed the docker image with flask and other libraries. It was working fine in local container.
In the flask it is app.run(), earlier we were specifying port 5000 as well.
I deployed the stack to heroku and it is successful. but when I try to test it in the browser by typing predictpy.heroku.com:5000
is erroring out:
Port 5000
I am trying
predictpy.heroku.com
refused to connect.
Any idea? Am I missing something when deploying the flask application to Heroku?
docker heroku flask containers
I have pushed the docker image with flask and other libraries. It was working fine in local container.
In the flask it is app.run(), earlier we were specifying port 5000 as well.
I deployed the stack to heroku and it is successful. but when I try to test it in the browser by typing predictpy.heroku.com:5000
is erroring out:
Port 5000
I am trying
predictpy.heroku.com
refused to connect.
Any idea? Am I missing something when deploying the flask application to Heroku?
docker heroku flask containers
docker heroku flask containers
asked Nov 14 '18 at 12:20
user3721687user3721687
877
877
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23
add a comment |
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23
add a comment |
1 Answer
1
active
oldest
votes
I suppose you have specified a web
process in your procfile. It is "the only process type that can receive external HTTP traffic from Heroku’s routers" and it listens to port 80. So if you haven't do so, add proxy traffic from 5000 to 80 by web: gunicorn -b 0.0.0.0:$PORT app:app
and visit predictpy.heroku.com
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the commandrun: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?
– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain
– Siyu
Nov 14 '18 at 15:54
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300133%2frun-heroku-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I suppose you have specified a web
process in your procfile. It is "the only process type that can receive external HTTP traffic from Heroku’s routers" and it listens to port 80. So if you haven't do so, add proxy traffic from 5000 to 80 by web: gunicorn -b 0.0.0.0:$PORT app:app
and visit predictpy.heroku.com
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the commandrun: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?
– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain
– Siyu
Nov 14 '18 at 15:54
add a comment |
I suppose you have specified a web
process in your procfile. It is "the only process type that can receive external HTTP traffic from Heroku’s routers" and it listens to port 80. So if you haven't do so, add proxy traffic from 5000 to 80 by web: gunicorn -b 0.0.0.0:$PORT app:app
and visit predictpy.heroku.com
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the commandrun: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?
– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain
– Siyu
Nov 14 '18 at 15:54
add a comment |
I suppose you have specified a web
process in your procfile. It is "the only process type that can receive external HTTP traffic from Heroku’s routers" and it listens to port 80. So if you haven't do so, add proxy traffic from 5000 to 80 by web: gunicorn -b 0.0.0.0:$PORT app:app
and visit predictpy.heroku.com
I suppose you have specified a web
process in your procfile. It is "the only process type that can receive external HTTP traffic from Heroku’s routers" and it listens to port 80. So if you haven't do so, add proxy traffic from 5000 to 80 by web: gunicorn -b 0.0.0.0:$PORT app:app
and visit predictpy.heroku.com
edited Nov 14 '18 at 15:33
answered Nov 14 '18 at 14:49
SiyuSiyu
2,7831927
2,7831927
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the commandrun: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?
– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain
– Siyu
Nov 14 '18 at 15:54
add a comment |
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the commandrun: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?
– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain
– Siyu
Nov 14 '18 at 15:54
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the command
run: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?– user3721687
Nov 14 '18 at 15:09
Do I need to install gunicorn separately? Now I am getting Running on 127.0.0.1:5000 , but as you mentioned I did created Procfile and wrote the command
run: web: gunicorn app:app
will it expose the flask application to port 80? can you please brief me?– user3721687
Nov 14 '18 at 15:09
check if you have gunicorn in your requirements.txt.
gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain– Siyu
Nov 14 '18 at 15:54
check if you have gunicorn in your requirements.txt.
gunicorn -b 0.0.0.0:$PORT app:app
will bind the port to a port that heroku injected via the env, then heroku's route takes charge routing it to port 80 on the virtual domain– Siyu
Nov 14 '18 at 15:54
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300133%2frun-heroku-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
also I open the terminal and run the terminal in heroku and manually triggered the flask py code. it is running on 127.0.0.1:5000
– user3721687
Nov 14 '18 at 12:23