Closed jinrenjie closed 1 year ago
Hey,
currently the redis URL is hardcoded here: https://github.com/txty-io/texterify/blob/master/config/initializers/sidekiq.rb
I think adding a new env variable would solve your problem?
@chrztoph Yes, my current solution is to directly modify the /var/www/texterify/config/initializers/sidekiq.rb
file in the Docker image.
This is not a good solution, so I want to create a PR to fix this problem, but I'm not sure if the following code is Ruby syntactic, as I know nothing about Ruby 😂:
Sidekiq.configure_server { |config| config.redis = { url: "#{ENV.fetch('REDIS_URL', 'redis://redis:6379/0')}" } }
Sidekiq.configure_client { |config| config.redis = { url: "#{ENV.fetch('REDIS_URL', 'redis://redis:6379/0')}" } }
As the above log shows, sidekiq is not using the
REDIS_URL
that I defined in.env
file.This caused me to always fail when connect to the existing external Redis Server, and the container could not run normally!