Tag: 泊坞子

如何将localhost RoR应用程序绑定到语言docker容器?

我有一个在轨道应用程序,这是在0.0.0.0:3000 ruby​​和rubydocker容器在端口0.0.0.0:80。 我想绑定localhost RoR应用程序与docker集装箱,因为postgreSQL在docker集装箱内运行,并希望连接RoR应用程序与docker集装箱内的PostgreSQL。 如何使RoR应用程序和docker容器postgrePSQL之间build立数据库连接。 这是我的RoR控制器。 class CronController < ApplicationController # slack channel hook $slackHook = "https://hooks.slack.com/services/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" $discourseHost = 'community.cloudways.com/'; $messageText = "New Notification"; # import http module require 'net/http' =begin A method which build connection with postgreSQL and fetch last 24hr records =end def slackNotification logger.debug "*******Cron Started********" begin $query = "SELECT users.username AS […]