diff --git a/docker-compose.yml b/docker-compose.yml index 03b2233..a1109f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,7 @@ services: - 1.1.1.1 environment: - NODE_ENV=production + - REDIS_URL=redis://gwei-bot-redis:6379 - DISCORD_BOT_TOKEN - DISCORD_CLIENT - RPC_URL diff --git a/src/redis.ts b/src/redis.ts index e328d76..ba84574 100644 --- a/src/redis.ts +++ b/src/redis.ts @@ -1,9 +1,9 @@ import { createClient } from 'redis'; +const redisUrl = process.env.REDIS_URL || 'redis://localhost:6379'; + // Create a new Redis client -const client = createClient({ - url: 'redis://gwei-bot-redis:6379' -}); +const client = createClient({ url: redisUrl }); // Log any Redis errors to the console client.on('error', (error) => {