From 0d8a04b43c875997345d0e9c63b1072c995a24d2 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Sat, 27 Apr 2024 11:04:23 -0400 Subject: [PATCH] chore: for redis, use service name as the default (#9109) chore: use service name as default redis hostname --- docker/example.env | 2 -- docs/docs/install/environment-variables.md | 18 +++++++++--------- e2e/docker-compose.yml | 1 - server/src/config.ts | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/docker/example.env b/docker/example.env index 5260e24ff4..caf523932d 100644 --- a/docker/example.env +++ b/docker/example.env @@ -16,5 +16,3 @@ DB_PASSWORD=postgres DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich - -REDIS_HOSTNAME=immich_redis diff --git a/docs/docs/install/environment-variables.md b/docs/docs/install/environment-variables.md index 7e9d9c9a92..bba01c2eb0 100644 --- a/docs/docs/install/environment-variables.md +++ b/docs/docs/install/environment-variables.md @@ -79,15 +79,15 @@ When `DB_URL` is defined, the `DB_HOSTNAME`, `DB_PORT`, `DB_USERNAME`, `DB_PASSW ## Redis -| Variable | Description | Default | Services | -| :--------------- | :------------- | :------------: | :-------------------- | -| `REDIS_URL` | Redis URL | | server, microservices | -| `REDIS_HOSTNAME` | Redis Host | `immich_redis` | server, microservices | -| `REDIS_PORT` | Redis Port | `6379` | server, microservices | -| `REDIS_DBINDEX` | Redis DB Index | `0` | server, microservices | -| `REDIS_USERNAME` | Redis Username | | server, microservices | -| `REDIS_PASSWORD` | Redis Password | | server, microservices | -| `REDIS_SOCKET` | Redis Socket | | server, microservices | +| Variable | Description | Default | Services | +| :--------------- | :------------- | :-----: | :-------------------- | +| `REDIS_URL` | Redis URL | | server, microservices | +| `REDIS_HOSTNAME` | Redis Host | `redis` | server, microservices | +| `REDIS_PORT` | Redis Port | `6379` | server, microservices | +| `REDIS_DBINDEX` | Redis DB Index | `0` | server, microservices | +| `REDIS_USERNAME` | Redis Username | | server, microservices | +| `REDIS_PASSWORD` | Redis Password | | server, microservices | +| `REDIS_SOCKET` | Redis Socket | | server, microservices | :::info diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 85b201f98c..a1daf0207b 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -12,7 +12,6 @@ x-server-build: &server-common - DB_USERNAME=postgres - DB_PASSWORD=postgres - DB_DATABASE_NAME=immich - - REDIS_HOSTNAME=redis - IMMICH_MACHINE_LEARNING_ENABLED=false - IMMICH_METRICS=true volumes: diff --git a/server/src/config.ts b/server/src/config.ts index 85139b1b07..f6af82a94d 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -52,7 +52,7 @@ function parseRedisConfig(): RedisOptions { } } return { - host: process.env.REDIS_HOSTNAME || 'immich_redis', + host: process.env.REDIS_HOSTNAME || 'redis', port: Number.parseInt(process.env.REDIS_PORT || '6379'), db: Number.parseInt(process.env.REDIS_DBINDEX || '0'), username: process.env.REDIS_USERNAME || undefined,