Hi all,
I am required to set authentication for the Redis server (bitnami/redis image) (Email server microservices) for production on-site deployment email server.
Setting the password from the docker-compose file using REDIS_PASSWORD : 123abc as the environment variable, creates the password authentication successfully. the issue I am having is specifying the new password in my Redis connection string which is used by ListenerAPI & ListenerWorker containers.
The docker-compose file
version: "3.8"
services:
redisOfficial:
image: 'docker.io/bitnami/redis'
container_name: 'redisOfficial'
restart: unless-stopped
environment:
REDIS_PASSWORD : 123abc # redis Authentication mode
REDIS_AOF_ENABLED : "no"
ports:
- "6379:6379"
rabbitmqOfficial:
image: rabbitmq:management-alpine
container_name: 'rabbitmqOfficial'
restart: unless-stopped
volumes:
- ./rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
- ./definitions.json:/etc/rabbitmq/definitions.json:ro
ports:
- 5672:5672 # AMQP protocol port
- 15672:15672 # HTTP management UI
ListenerAPI:
image: registry.creatio.com/emaillistener:1.0.24
container_name: 'ListenerAPI'
restart: unless-stopped
ports:
- 10000:8080 # Port forward. External port:local port
# - 10001:8443 # SSL port by default. Uncomment if https endpoint needed
environment:
ExchangeListenerRedisHost: redisOfficial:6379 # Redis connection
ExchangeListenerRedisPassword: "123abc"
ExchangeListenerRedisDatabase: 0 # Redis DB
PodName: ExchangeListener
# SSL certificate parameters by default. Uncomment if https endpoint needed
# ASPNETCORE_Kestrel__Certificates__Default__Password: password
# ASPNETCORE_Kestrel__Certificates__Default__Path: /https/el_self_signed.pfx
depends_on:
- redisOfficial
- rabbitmqOfficial
volumes:
# SSL certificate folder by default. Uncomment if https endpoint needed
# - ./ssl:/https:ro
- ./appsettings.json:/app/config/appsettings.json:ro
- ./rmqsecret.json:/app/config/rabbitmq.secrets.json:ro
# dns:
# - 10.0.7.1
# - 10.0.7.2
# dns_search:
# - tscrm.com
ListenerWorker:
image: registry.creatio.com/emaillistener-worker:1.0.24
container_name: 'ListenerWorker'
restart: unless-stopped
environment:
ExchangeListenerRedisHost: redisOfficial:6379 # Redis connection
ExchangeListenerRedisPassword: "123abc"
ExchangeListenerRedisDatabase: 0 # Redis DB
PodName: ExchangeListenerWorker
depends_on:
- redisOfficial
- rabbitmqOfficial
volumes:
- ./appsettings.json:/app/appsettings.json:ro
- ./rmqsecret.json:/app/appsettings.Production.json:ro
# dns:
# - 10.0.7.1
# - 10.0.7.2
# dns_search:
# - tscrm.com\
When I run this container in docker, i am getting blow mentioned container log for the LisenterAPI container
2024-01-24 13:24:01 [Microsoft.AspNetCore.Server.Kestrel] 2024-01-24 07:54:01,426 [40] ERROR: Connection id "0HN0SM07SMRGL", Request id "0HN0SM07SMRGL:00000018": An unhandled exception was thrown by the application.
2024-01-24 13:24:01 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). There was an authentication failure; check that passwords (or client certificates) are configured correctly.
2024-01-24 13:24:01 at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log, Nullable`1 serverType) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 733
I suspect the way (syntax) password is specified docker-compose file is not supported for the LisenterAPI container. How to fix this issue?
Note: Container connections work fine because, if I use ALLOW_EMPTY_PASSWORD : "yes" for redis environment variable, the service works perfectly.