Dokku:没有看到容器端口

时间:2019-02-13 09:06:12

标签: docker nginx dokku

如果有人对此有所了解,请在此处呼唤一点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上看不到该应用程序(一直打开),但是如果我检查端口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]#

真的很感谢对此的想法...谢谢。

1 个答案:

答案 0 :(得分:0)

在Slack中,在Dokku支持的帮助下,这很容易解决。我引用的是旧版文档。

对此的解决方法是:

dokku proxy:disable fr-intacct-staging
dokku network:set fr-intacct-staging bind-all-interfaces true
dokku ps:rebuild fr-intacct-staging

这里的文档很棒:http://dokku.viewdocs.io 但是..请确保选择右下角的版本。版本之间的差异很大。