Fix redis urls

This commit is contained in:
Eugene Burmakin
2025-06-09 14:10:49 +02:00
parent 1ed01a0c0b
commit 3d26a49627
8 changed files with 13 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ services:
tty: true tty: true
environment: environment:
RAILS_ENV: development RAILS_ENV: development
REDIS_URL: redis://dawarich_redis:6379/0 REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db DATABASE_HOST: dawarich_db
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password DATABASE_PASSWORD: password

View File

@@ -3,4 +3,4 @@ DATABASE_USERNAME=postgres
DATABASE_PASSWORD=password DATABASE_PASSWORD=password
DATABASE_NAME=dawarich_development DATABASE_NAME=dawarich_development
DATABASE_PORT=5432 DATABASE_PORT=5432
REDIS_URL=redis://localhost:6379/1 REDIS_URL=redis://localhost:6379

View File

@@ -3,4 +3,4 @@ DATABASE_USERNAME=postgres
DATABASE_PASSWORD=password DATABASE_PASSWORD=password
DATABASE_NAME=dawarich_test DATABASE_NAME=dawarich_test
DATABASE_PORT=5432 DATABASE_PORT=5432
REDIS_URL=redis://localhost:6379/1 REDIS_URL=redis://localhost:6379

View File

@@ -1,11 +1,11 @@
development: development:
adapter: redis adapter: redis
url: <%= ENV['REDIS_URL'] %> url: <%= "#{ENV.fetch("REDIS_URL")}/2" %>
test: test:
adapter: test adapter: test
production: production:
adapter: redis adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> url: <%= "#{ENV.fetch("REDIS_URL")}/2" %>
channel_prefix: dawarich_production channel_prefix: dawarich_production

View File

@@ -4,7 +4,7 @@ settings = {
debug_mode: true, debug_mode: true,
timeout: 5, timeout: 5,
units: :km, units: :km,
cache: Redis.new, cache: Redis.new(url: ENV['REDIS_URL']),
always_raise: :all, always_raise: :all,
http_headers: { http_headers: {
'User-Agent' => "Dawarich #{APP_VERSION} (https://dawarich.app)" 'User-Agent' => "Dawarich #{APP_VERSION} (https://dawarich.app)"

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
Sidekiq.configure_server do |config| Sidekiq.configure_server do |config|
config.redis = { url: ENV['REDIS_URL'] } config.redis = { url: "#{ENV['REDIS_URL']}/1" }
config.logger = Sidekiq::Logger.new($stdout) config.logger = Sidekiq::Logger.new($stdout)
if ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true' if ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true'

View File

@@ -56,7 +56,7 @@ services:
restart: on-failure restart: on-failure
environment: environment:
RAILS_ENV: production RAILS_ENV: production
REDIS_URL: redis://dawarich_redis:6379/0 REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db DATABASE_HOST: dawarich_db
DATABASE_PORT: 5432 DATABASE_PORT: 5432
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
@@ -111,7 +111,7 @@ services:
restart: on-failure restart: on-failure
environment: environment:
RAILS_ENV: production RAILS_ENV: production
REDIS_URL: redis://dawarich_redis:6379/0 REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db DATABASE_HOST: dawarich_db
DATABASE_PORT: 5432 DATABASE_PORT: 5432
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
@@ -132,7 +132,7 @@ services:
max-size: "100m" max-size: "100m"
max-file: "5" max-file: "5"
healthcheck: healthcheck:
test: [ "CMD-SHELL", "bundle exec sidekiqmon processes | grep $${HOSTNAME}" ] test: [ "CMD-SHELL", "pgrep -f sidekiq" ]
interval: 10s interval: 10s
retries: 30 retries: 30
start_period: 30s start_period: 30s

View File

@@ -59,7 +59,7 @@ services:
restart: on-failure restart: on-failure
environment: environment:
RAILS_ENV: development RAILS_ENV: development
REDIS_URL: redis://dawarich_redis:6379/0 REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db DATABASE_HOST: dawarich_db
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
@@ -112,7 +112,7 @@ services:
restart: on-failure restart: on-failure
environment: environment:
RAILS_ENV: development RAILS_ENV: development
REDIS_URL: redis://dawarich_redis:6379/0 REDIS_URL: redis://dawarich_redis:6379
DATABASE_HOST: dawarich_db DATABASE_HOST: dawarich_db
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
@@ -131,7 +131,7 @@ services:
max-size: "100m" max-size: "100m"
max-file: "5" max-file: "5"
healthcheck: healthcheck:
test: [ "CMD-SHELL", "bundle exec sidekiqmon processes | grep $${HOSTNAME}" ] test: [ "CMD-SHELL", "pgrep -f sidekiq" ]
interval: 10s interval: 10s
retries: 30 retries: 30
start_period: 30s start_period: 30s