diff --git a/.env.dist b/.env.dist index 6ae3d9e..fdfb144 100644 --- a/.env.dist +++ b/.env.dist @@ -16,6 +16,7 @@ POSTGRES_IMAGE=postgres:15.0 # REDIS REDIS_IMAGE=redis:7.0-alpine REDIS_HOST=v3-user-redis +REDIS_PASSWORD=redis REDIS_PORT=6379 # CACHE diff --git a/docker-compose.yml b/docker-compose.yml index 468f23f..dc7718a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: v3-user-redis: container_name: v3-user-redis image: ${REDIS_IMAGE} + command: redis-server --requirepass ${REDIS_PASSWORD} ports: - 6501:6379 volumes: diff --git a/src/modules/configuration/configuration.module.ts b/src/modules/configuration/configuration.module.ts index 2cc0957..fab6fe0 100644 --- a/src/modules/configuration/configuration.module.ts +++ b/src/modules/configuration/configuration.module.ts @@ -21,6 +21,7 @@ import { SetConfigurationUseCase } from './domain/usecases/set-configuration.use config: { host: configService.get('REDIS_HOST'), port: configService.get('REDIS_PORT'), + password: configService.get('REDIS_PASSWORD'), }, }), }), diff --git a/src/modules/users/users.module.ts b/src/modules/users/users.module.ts index d8731fe..736077e 100644 --- a/src/modules/users/users.module.ts +++ b/src/modules/users/users.module.ts @@ -39,6 +39,7 @@ import { UserProfile } from './mappers/user.profile'; store: await redisStore({ host: configService.get('REDIS_HOST'), port: configService.get('REDIS_PORT'), + password: configService.get('REDIS_PASSWORD'), ttl: configService.get('CACHE_TTL'), }), }),