seanmor5
Heroku App failed to bind to $PORT in 60 seconds
Hi all, I have a Elixir Umbrella with a Phoenix Web app that I am attempting to deploy to Heroku using Docker.
The Docker build and release succeeds; however, whenever I attempt to visit the running application I get the following error:
2019-01-16T18:11:28.595542+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-01-16T18:11:28.595632+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-01-16T18:11:28.685658+00:00 heroku[web.1]: Process exited with status 137
I am using Phoenix 1.4. I tried a few fixes, namely setting the http config variable correctly. My Phoenix configuration is as follows:
config :bazaar, BazaarWeb.Endpoint,
load_from_system_env: true,
http: [port: {:system, "PORT"}],
url: [host: {:system, "HOST"}, port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
The host environment variable is properly set inside the Heroku configuration. I’m not sure what else to try.
Most Liked
gcauchon
It is so simple to build an OTP release with Distillery, wrap it in a Docker image and deploy a container on Heroku; there are no reason to use the buildpack-based deployment anymore.
Furthermore, mix is a development tool, that will one day support building releases. It was never intended to run production code!
gcauchon
Is your docker image based on mix phx.server or are you using distillery to create an OTP release?
If your setup uses Distillery (which I strongly suggest), you are missing a few configuration like described in the guide:
serverconfigures the endpoint to boot the Cowboy application http endpoint on start.rootconfigures the application root for serving static files.versionensures that the asset cache will be busted on versioned application upgrades.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









