简体   繁体   English

Dokku postgres服务名称和database.yml

[英]Dokku postgres service name and database.yml

When I created my Ruby on Rails application, I used the Unix “dot” convention to refer to the current directory. 创建Ruby on Rails应用程序时,我使用Unix的“点”约定来引用当前目录。 My current directory's name was fireworks_app , so my application was given the name of fireworks_app . 我当前目录的名称为fireworks_app ,因此我的应用程序被命名为fireworks_app

The database.yml file was created accordingly, so that for each environment the corresponding database was named with the formula fireworks_app_environment . 相应地创建了database.yml文件,因此对于每个环境,相应的数据库都使用公式fireworks_app_environment命名。

I would like to install Dokku in my VPS. 我想在我的VPS中安装Dokku。 I wonder what alternatives do I have to naming my Dokku application fireworks_app , and the Dokku postgres service respecting what is reported in database.yml ( fireworks_app_production ). 我想知道我必须使用什么替代方法来命名我的Dokku应用程序fireworks_app和Dokku postgres服务,以尊重database.ymlfireworks_app_production )中报告的内容。

This would imply that I create my Dokku application and my postgres service as follows: 这意味着我将按以下方式创建我的Dokku应用程序和postgres服务:

$ dokku apps:create fireworks_app
$ dokku postgres:create fireworks_app_production
$ dokku postgres:link fireworks_app_production fireworks_app

This looks to me a bit awkward: there is no need to specify production for my VPS, for instance. 在我看来,这有点尴尬:例如,无需为我的VPS指定生产
Instead, I would prefer to name my application fireworks and all my services fireworks . 相反,我更愿意将应用程序fireworks和所有服务fireworks命名。 Thus I would use instead the following more compact commands and names: 因此,我将改用以下更紧凑的命令和名称:

$ dokku apps:create fireworks
$ dokku postgres:create fireworks
$ dokku postgres:link fireworks fireworks

Is it possible in this regard to edit database.yml and change fireworks_app_production into a more compact fireworks ? 在这方面是否可以编辑database.yml并将fireworks_app_production更改为更紧凑的fireworks What changes can I (and am I expected to) do to avoid appending _app and _app_production to my Dokku application and service names? 为了避免将_app_app_production附加到我的Dokku应用程序和服务名称中,我可以做哪些更改(并且我应该做些什么)?

You don't have to worry about the database.yml file, you can do this if you want without problems 您不必担心database.yml文件,如果需要,可以执行此操作

$ dokku apps:create fireworks
$ dokku postgres:create fireworks
$ dokku postgres:link fireworks fireworks

you can use the name that you want on the app and on postgres. 您可以在应用程序和postgres上使用所需的名称。 just be sure that you link the ones that you created, no mater the name. 只要确保您链接的是您创建的链接,就不用命名了。

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

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