add init redis host/port
Signed-off-by: Luan Shengde shdluan@163.com --- container/send-internet-mail/send-internet-mail.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/container/send-internet-mail/send-internet-mail.rb b/container/send-internet-mail/send-internet-mail.rb index 8fdaa0d..6003028 100755 --- a/container/send-internet-mail/send-internet-mail.rb +++ b/container/send-internet-mail/send-internet-mail.rb @@ -6,7 +6,10 @@ require 'mail' require 'sinatra'
-require "#{ENV['CCI_SRC']}/lib/mail-post" +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp +REDIS_PORT = ENV['REDIS_PORT'] + +require_relative '../../lib/mail-post'
smtp = { address: 'smtp.qq.com',
On Thu, Jan 14, 2021 at 11:37:41AM +0800, Luan Shengde wrote:
add init redis host/port
Signed-off-by: Luan Shengde shdluan@163.com
container/send-internet-mail/send-internet-mail.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/container/send-internet-mail/send-internet-mail.rb b/container/send-internet-mail/send-internet-mail.rb index 8fdaa0d..6003028 100755 --- a/container/send-internet-mail/send-internet-mail.rb +++ b/container/send-internet-mail/send-internet-mail.rb @@ -6,7 +6,10 @@ require 'mail' require 'sinatra'
-require "#{ENV['CCI_SRC']}/lib/mail-post" +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp
Why you don't get the REDIS_HOST from ENV like getting REDIS_PORT?
Thanks, Xueliang
+REDIS_PORT = ENV['REDIS_PORT']
+require_relative '../../lib/mail-post'
smtp = { address: 'smtp.qq.com', -- 2.23.0
On Thu, Jan 14, 2021 at 02:05:58PM +0800, Cao Xueliang wrote:
On Thu, Jan 14, 2021 at 11:37:41AM +0800, Luan Shengde wrote:
add init redis host/port
Signed-off-by: Luan Shengde shdluan@163.com
container/send-internet-mail/send-internet-mail.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/container/send-internet-mail/send-internet-mail.rb b/container/send-internet-mail/send-internet-mail.rb index 8fdaa0d..6003028 100755 --- a/container/send-internet-mail/send-internet-mail.rb +++ b/container/send-internet-mail/send-internet-mail.rb @@ -6,7 +6,10 @@ require 'mail' require 'sinatra'
-require "#{ENV['CCI_SRC']}/lib/mail-post" +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp
Why you don't get the REDIS_HOST from ENV like getting REDIS_PORT?
because in the the container, the redis host is 172.x.x.x,
Thanks, Luan Shengde
Thanks, Xueliang
+REDIS_PORT = ENV['REDIS_PORT']
+require_relative '../../lib/mail-post'
smtp = { address: 'smtp.qq.com', -- 2.23.0
On Thu, Jan 14, 2021 at 02:09:10PM +0800, Luan Shengde wrote:
On Thu, Jan 14, 2021 at 02:05:58PM +0800, Cao Xueliang wrote:
On Thu, Jan 14, 2021 at 11:37:41AM +0800, Luan Shengde wrote:
add init redis host/port
Signed-off-by: Luan Shengde shdluan@163.com
container/send-internet-mail/send-internet-mail.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/container/send-internet-mail/send-internet-mail.rb b/container/send-internet-mail/send-internet-mail.rb index 8fdaa0d..6003028 100755 --- a/container/send-internet-mail/send-internet-mail.rb +++ b/container/send-internet-mail/send-internet-mail.rb @@ -6,7 +6,10 @@ require 'mail' require 'sinatra'
-require "#{ENV['CCI_SRC']}/lib/mail-post" +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp
Why you don't get the REDIS_HOST from ENV like getting REDIS_PORT?
because in the the container, the redis host is 172.x.x.x,
But if the redis and send-internel-mail container are not in the same host machine, how can you request redis use 172.x?
Thanks, Xueliang
Thanks, Luan Shengde
Thanks, Xueliang
+REDIS_PORT = ENV['REDIS_PORT']
+require_relative '../../lib/mail-post'
smtp = { address: 'smtp.qq.com', -- 2.23.0
-require "#{ENV['CCI_SRC']}/lib/mail-post" +REDIS_HOST = %x(/sbin/ip route | awk '/default/ {print $3}').chomp
Why you don't get the REDIS_HOST from ENV like getting REDIS_PORT?
because in the the container, the redis host is 172.x.x.x,
But if the redis and send-internel-mail container are not in the same host machine, how can you request redis use 172.x?
if they are in the same group, they will have the save docker ips.
Thanks, Luan Shengde
Thanks, Xueliang
Thanks, Luan Shengde
Thanks, Xueliang
+REDIS_PORT = ENV['REDIS_PORT']
+require_relative '../../lib/mail-post'
smtp = { address: 'smtp.qq.com', -- 2.23.0