mirror of https://github.com/mastodon/mastodon
Add redis ports internally, append comma if we've resolved IPs
This commit is contained in:
parent
8ef6588749
commit
b0f1b71779
|
@ -52,6 +52,8 @@ services:
|
|||
- REDIS_PASSWORD=str0ng_passw0rd
|
||||
networks:
|
||||
- internal_network
|
||||
ports:
|
||||
- '6379:6379'
|
||||
redis-replica:
|
||||
image: 'bitnami/redis:latest'
|
||||
environment:
|
||||
|
@ -61,6 +63,8 @@ services:
|
|||
- REDIS_PASSWORD=str0ng_passw0rd
|
||||
networks:
|
||||
- internal_network
|
||||
ports:
|
||||
- '6379:6379'
|
||||
redis-sentinel:
|
||||
image: 'bitnami/redis-sentinel:latest'
|
||||
environment:
|
||||
|
|
|
@ -53,8 +53,9 @@ class RedisConfiguration
|
|||
|
||||
unless ENV['REDIS_SENTINEL'].include? ','
|
||||
ips = Resolv.getaddresses(ENV['REDIS_SENTINEL'])
|
||||
port = ENV.fetch('REDIS_SENTINEL_PORT', '26379')
|
||||
|
||||
ENV['REDIS_SENTINEL'] = ips.map do |ip|
|
||||
port = ENV.fetch('REDIS_SENTINEL_PORT', '26379')
|
||||
"#{ip}:#{port}"
|
||||
end.join(',')
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ def setup_redis_env_url(prefix = nil, defaults = true)
|
|||
|
||||
ENV["#{prefix}REDIS_SENTINEL"] = ips.map do |ip|
|
||||
"#{ip}:#{port}"
|
||||
end.join(',')
|
||||
end.join(',').concat(',')
|
||||
end
|
||||
|
||||
ENV["#{prefix}REDIS_URL"] = "redis://:#{password}@#{sentinel_master}"
|
||||
|
|
Loading…
Reference in New Issue