Add ability to pass redis hostname as env var (#174)

* Add ability to pass redis hostname as env var

* Read postgres host from env var in microservices

* Update .env.example with postgres and redis hostname vars
This commit is contained in:
Pavle Portic
2022-05-24 00:23:02 +02:00
committed by GitHub
parent 87b15c60c0
commit a44043a4e5
4 changed files with 17 additions and 5 deletions

View File

@@ -3,12 +3,13 @@ import { RedisClient } from 'redis';
import { ServerOptions } from 'socket.io';
import { createAdapter } from 'socket.io-redis';
// const pubClient = createClient({ url: 'redis://immich_redis:6379' });
const redis_host = process.env.REDIS_HOSTNAME || 'immich_redis'
// const pubClient = createClient({ url: `redis://${redis_host}:6379` });
// const subClient = pubClient.duplicate();
const pubClient = new RedisClient({
host: redis_host,
port: 6379,
host: 'immich_redis',
});
const subClient = pubClient.duplicate();