Dokku:没有看到集装箱港口

问题描述 投票:0回答:1

如果有人对此有所了解,请在这里打电话给一个小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]#

真的很感激这个想法...谢谢。

docker nginx dokku
1个回答
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但是..请确保选择右下角的版本。版本之间的差异很大。

© www.soinside.com 2019 - 2024. All rights reserved.