【发布时间】:2019-02-13 09:06:11
【问题描述】:
如果有人对此有所了解,请在这里寻求一点 Dokku 帮助。我已经构建了一个新的 Dokku 服务器,并正在尝试部署一个预先存在的应用程序。我知道这个应用程序很好,因为它可以在另一个 dokku 主机上运行,没有问题。
当我在此服务器上部署应用程序时,它返回一个地址......这是无效的。这是盒子的主机名,这很好。我不指望这会奏效。但关键是,当我部署到另一个(工作)dokku 主机时,它返回两个 URL。一个用于nginx,一个用于container,当我导航到容器端口时(每次部署都是随机的,可能是因为容器共存时端口冲突),我可以看到应用程序。
这告诉我 nginx 代理关闭了,容器绑定到了 dokku 主机上的外部接口,对吧?
所以,如果我在新服务器上运行dokku proxy:disable app,然后运行docker ps,我看不到端口下绑定的任何内容。
[root@dokku-host ~]# dokku proxy:disable fr-intacct-staging
-----> Disabling proxy for app (fr-intacct-staging)
-----> Setting config vars
DOKKU_DISABLE_PROXY: 1
-----> Unsetting DOKKU_PROXY_PORT
-----> Skipping DOKKU_PROXY_SSL_PORT, it is not set in the environment
-----> Unsetting DOKKU_PROXY_PORT_MAP
-----> VHOST support disabled, deleting fr-intacct-staging/VHOST
-----> VHOST support disabled, deleting fr-intacct-staging/URLS
-----> Setting config vars
NO_VHOST: 1
-----> Releasing fr-intacct-staging (dokku/fr-intacct-staging:latest)...
-----> Deploying fr-intacct-staging (dokku/fr-intacct-staging:latest)...
-----> App Procfile file found (/home/dokku/fr-intacct-staging/DOKKU_PROCFILE)
-----> DOKKU_SCALE file found (/home/dokku/fr-intacct-staging/DOKKU_SCALE)
=====> web=1
-----> Attempting pre-flight checks
For more efficient zero downtime deployments, create a file CHECKS.
See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
-----> Default container check successful!
-----> Running post-deploy
-----> VHOST support disabled. Skipping domains setup
-----> nginx support is disabled for app (fr-intacct-staging).
-----> deleting nginx.conf
-----> reloading nginx after nginx.conf deletion
-----> Setting config vars
DOKKU_APP_RESTORE: 1
-----> Found previous container(s) (9f0d2416e9ed) named fr-intacct-staging.web.1
=====> Renaming container (9f0d2416e9ed) fr-intacct-staging.web.1 to fr-intacct-staging.web.1.1550048431
=====> Renaming container (d9f6006f0eaf) naughty_cartwright to fr-intacct-staging.web.1
-----> Shutting down old containers in 60 seconds
=====> 9f0d2416e9ed1f44716e16b3f39236cde9d0d5594bb60c0823dee0053d49e6f8
=====> Application deployed:
http://dokku-host.c.fr-intacct-staging.internal:5000 (container)
因此,如果我从浏览器测试该框的公共 IP,在端口 5000 上我看不到应用程序(fw 一直打开),但如果我检查端口 80,我确实看到了 nginx 保存页面。所以 nginx 在 80 端口上运行,我希望看到应用程序在 5000 端口上运行?
我看到了这个: [root@dokku-host ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9f6006f0eaf dokku/fr-intacct-staging:latest "/start web" 4 minutes ago Up 4 minutes fr-intacct-staging.web.1
似乎没有任何东西绑定到外部接口。我当然希望在那里看到像0.0.0.0/0:5000 这样的东西,不是吗?
我是 Dokku 的新手,但有一些 Docker 经验。
编辑:只是一些额外的信息......
来自旧主机:
root@dokku:/home/dokku/fr-intacct# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5fbd53343888 dokku/fr-intacct:latest "/start web" 5 months ago Up 5 months 0.0.0.0:32792->5000/tcp fr-intacct.web.1
root@dokku:/home/dokku/fr-intacct# dokku config fr-intacct
=====> fr-intacct config vars
DOKKU_APP_RESTORE: 1
DOKKU_NGINX_PORT: 80
NO_VHOST: 1
root@dokku:/home/dokku/fr-intacct# dokku urls fr-intacct
http://dokku.internal.fr.com:32792 (container)
http://dokku.internal.fr.com:80 (nginx)
来自新主机:
[root@dokku-host fr-intacct-staging]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9f6006f0eaf dokku/fr-intacct-staging:latest "/start web" 14 minutes ago Up 14 minutes fr-intacct-staging.web.1
[root@dokku-host fr-intacct-staging]# dokku config fr-intacct-staging
=====> fr-intacct-staging env vars
DOKKU_APP_RESTORE: 1
DOKKU_APP_TYPE: herokuish
DOKKU_DISABLE_PROXY: 1
GIT_REV: 337bd92c233fc6b7e17246bf568fc30370d3e656
NO_VHOST: 1
[root@dokku-host fr-intacct-staging]# dokku urls fr-intacct-staging
http://dokku-host.c.fr-intacct-staging.internal:5000 (container)
我已尝试将配置设置与dokku config set fr-intacct-staging xxxx=xxx 相同,但无济于事。
我的直觉是我需要阻止它尝试使用 nginx 作为代理,将容器绑定到外部接口并直接连接到容器。
但是:
[root@dokku-host fr-intacct-staging]# dokku proxy:disable fr-intacct-staging
-----> proxy is already disable for app (fr-intacct-staging)
[root@dokku-host fr-intacct-staging]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9f6006f0eaf dokku/fr-intacct-staging:latest "/start web" 35 minutes ago Up 35 minutes fr-intacct-staging.web.1
[root@dokku-host fr-intacct-staging]#
非常感谢您对此的想法...谢谢。
【问题讨论】: