繁体   English   中英

Dokku +龙卷风应用程序= 502 Bad Gateway

[英]Dokku + tornado app = 502 Bad Gateway

我想和独孤结交朋友。 我在DigitalOcean Droplet上运行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

如果直接运行该应用程序,它将成功启动anet,但仍然会出现502错误。

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

应用程序正在运行时,所有环境变量的拼写正确,诸如此类。 有任何想法吗?

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

对不起,愚蠢的问题。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM