dsj8086
2019-02-15 09:24
浏览 398

使用docker映像在Heroku上部署Go App + Vue.js

I am trying to deploy an app https://github.com/valasek/timesheet on Heroku using a docker image. App has a go backend (negroni/gorilla) and Vue.js/Vuetify.js on the frontend and is using PostgreSQL persistence.

I am stuck on deployment. I do not know how to debug, how to show the command line output, what is failing ... and any help highly appreciated.

Relevant Dockerfile - https://github.com/valasek/timesheet/blob/master/Dockerfile

Here are the steps I am doing:

> docker build --rm -f "Dockerfile" -t timesheet:latest .
Successfully tagged timesheet:latest
...

> heroku container:push timesheet:latest --app timesheet-cloud
...
The push refers to repository [registry.heroku.com/timesheet-cloud/timesheet]
...
Your image has been successfully pushed. You can now release it with the 'container:release' command.

> heroku container:release timesheet --app timesheet-cloud
Releasing images timesheet to timesheet-cloud... done

> heroku ps -a timesheet-cloud
Free dyno hours quota remaining this month: 971h 8m (97%)
Free dyno usage for this app: 0h 0m (0%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping

No dynos on ⬢ timesheet-cloud

> heroku logs --app timesheet-cloud
2019-02-15T08:33:49.373221+00:00 app[api]: Deployed timesheet (709022e100f9) by user <email-reducted>@gmail.com
2019-02-15T08:33:49.373221+00:00 app[api]: Release v20 created by user <email-reducted>@gmail.com
2019-02-15T08:34:43.901070+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=timesheet-cloud.herokuapp.com request_id=4c21eb79-5344-4d40-b341-8977128c873f fwd="195.250.152.42" dyno= connect= service= status=503 bytes= protocol=https
2019-02-15T08:34:44.842322+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=timesheet-cloud.herokuapp.com request_id=b66caaee-880a-46a0-918b-e778a49334f4 fwd="195.250.152.42" dyno= connect= service= status=503 bytes= protocol=https
2019-02-15T08:34:54.865321+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=timesheet-cloud.herokuapp.com request_id=d5af6aa7-0279-4f0e-a4cc-0f9e8682ec2f fwd="195.250.152.42" dyno= connect= service= status=503 bytes= protocol=https
2019-02-15T08:34:55.158317+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=timesheet-cloud.herokuapp.com request_id=2d69f4b5-9015-48de-9314-c493703818d1 fwd="195.250.152.42" dyno= connect= service= status=503 bytes= protocol=https
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanqinqian5299 2019-02-15 10:09
    已采纳

    This is likely to happen because Heroku does not detect any endpoint for your application (binded on port 3000 by default).

    Heroku attributes your app a dynamic port, and put the port value on the env variable named $PORT.

    Your app have to use the value specified by Heroku in this variable and listen for incoming connections on it, because that is where Heroku will forward connections.

    The variable has to be read when the app starts: https://help.heroku.com/PPBPA231/how-do-i-use-the-port-environment-variable-in-container-based-apps

    You can check current env variables on your app using heroku run printenv

    (I see you are using Viper, that should handle env variables. However they say in their documentation that when from env, it is case sensitive, maybe that could explain why it does not work for you: https://github.com/spf13/viper#working-with-environment-variables)

    评论
    解决 无用
    打赏 举报
  • 查看更多回答(1条)

相关推荐 更多相似问题