2

我正在努力与独库交朋友。我在 DigitalOcean 液滴上运行 dokku。

user@mypc:~$ cat Procfile 
web: python3 main.py

user@mypc:~$ git push dokku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 295 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Building app ...
-----> Installing ENV in build environment ...
   Python app detected
-----> Preparing Python runtime (python-3.4.0)
-----> Installing Setuptools (2.1)
-----> Installing Pip (1.5.4)
-----> Installing dependencies using Pip (1.5.4)
    < LONG INSTALL REQS LOG >
   Cleaning up...
-----> Discovering process types
   Procfile declares types -> web
-----> Releasing app ...
-----> Deploying app ...
-----> Cleaning up ...
=====> Application deployed:
   http://app.myapp.ru

To dokku@myapp.ru:app
   d2cd6b3..7733adf  master -> master

尽管下载成功,但我仍然收到 502 错误

root@myserver:~# dokku run app ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  17888  1496 ?        Ss+  08:41   0:00 /bin/bash /exec ps aux
root        13  0.0  0.2  15536  1128 ?        R+   08:41   0:00 ps aux

root@myserver:~# dokku logs app
[I 140324 08:41:37 main:75] Starting http server on localhost:5000

如果您直接运行应用程序,它会成功启动网络,但我仍然会收到 502 错误。

root@myserver:~# dokku run app python3 main.py
[I 140324 08:59:19 main:75] Starting http server on localhost:5000

所有环境变量拼写正确,以及应用程序运行时的类似情况。有任何想法吗?

4

2 回答 2

2

比我想象的要容易得多。我绑定了 0.0.0.0

对不起愚蠢的问题。

于 2014-03-24T10:10:36.880 回答
2

我遇到了同样的问题。绑定到 0.0.0.0 是问题的一部分。Dokku 还期望 Tornado 服务于端口 5000。因此,修复将服务器监听调用更改为:http_server.listen(5000, address='0.0.0.0')

于 2016-03-20T18:30:39.537 回答