dsj8086 2019-02-15 09:24
浏览 405
已采纳

使用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条)

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题