How do I expose ports on Heroku with a Dockerfile?

前端 未结 2 1253
陌清茗
陌清茗 2020-12-19 02:39

I am trying to deploy a Docker image on Heroku and am trying to understand how to expose multiple ports. Here is the Docker command that I am trying to run in the Heroku de

相关标签:
2条回答
  • 2020-12-19 03:03

    You may want to look at Dockhero add-on. It's a good way to deploy supplementary resources alongside your Heroku app, and it supports docker-compose with multi-port mapping. The web app itself should still be running on Heroku dynos.

    0 讨论(0)
  • 2020-12-19 03:14

    You can't - you should use the $PORT environment variable which will be randomly assigned and then mapped to port 80 by the Heroku routers. Also, only http requests are accepted. See https://devcenter.heroku.com/articles/container-registry-and-runtime#dockerfile-commands-and-runtime for more details.

    0 讨论(0)
提交回复
热议问题