From 6cb2fb95bd743f24a50952ebaa3c573d25e6c820 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 11 Nov 2026 04:04:00 +0000 Subject: [PATCH] Add external Redis example override Sets REDIS_CACHE_ENDPOINT and REDIS_STORE_ENDPOINT on every service that connects to Redis, including precise-code-intel-worker and syntactic-code-intel-worker, and disables the built-in redis-cache and redis-store containers. Amp-Thread-ID: https://ampcode.com/threads/T-5e703d95-d3ee-4486-9b11-630a3ae8b3e2 Co-authored-by: Amp --- .../docker-compose.override.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docker-compose/examples/external-redis/docker-compose.override.yaml diff --git a/docker-compose/examples/external-redis/docker-compose.override.yaml b/docker-compose/examples/external-redis/docker-compose.override.yaml new file mode 100644 index 000000000..b0526f1ad --- /dev/null +++ b/docker-compose/examples/external-redis/docker-compose.override.yaml @@ -0,0 +1,47 @@ +# Docker Compose override example of how to configure external Redis +# See https://sourcegraph.com/docs/self-hosted/external-services/redis + +# Each value is either host:port, or a Redis URL, ex. redis://:password@redis.example.com:6379/0 +# Use rediss:// for a TLS connection +x-env-vars-redis: &env-vars-redis + + REDIS_CACHE_ENDPOINT: redis-cache.example.com:6379 + REDIS_STORE_ENDPOINT: redis-store.example.com:6379 + + +# Every service which connects to Redis needs these variables +# Services without them try to connect to the built-in redis-cache and redis-store containers +services: + + sourcegraph-frontend-0: + environment: + <<: *env-vars-redis + + sourcegraph-frontend-internal: + environment: + <<: *env-vars-redis + + gitserver-0: + environment: + <<: *env-vars-redis + + searcher-0: + environment: + <<: *env-vars-redis + + worker: + environment: + <<: *env-vars-redis + + precise-code-intel-worker: + environment: + <<: *env-vars-redis + + syntactic-code-intel-worker: + environment: + <<: *env-vars-redis + + + # Disable built-in Redis + redis-cache: !reset {} + redis-store: !reset {}