From 1bbe0ab63b14f7061f19e82d66ba566f1319b0b1 Mon Sep 17 00:00:00 2001 From: opulencechuks Date: Thu, 3 Sep 2026 14:42:43 +0100 Subject: [PATCH] chore: remove unused redis service from docker-compose --- docker-compose.yml | 29 ----------------------- src/__tests__/container-resources.test.ts | 17 ------------- 2 files changed, 46 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 249156a..a7052a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,12 +12,8 @@ services: - PORT=3001 - ADMIN_SECRET_KEY=${ADMIN_SECRET_KEY} - PROJECT_REGISTRY_CONTRACT_ID=${PROJECT_REGISTRY_CONTRACT_ID} - - REDIS_URL=redis://redis:6379 # Keep the V8 heap ceiling under the container memory limit below (#225). - NODE_OPTIONS=--max-old-space-size=384 - depends_on: - redis: - condition: service_healthy volumes: - ./src:/app/src:ro restart: unless-stopped @@ -37,28 +33,3 @@ services: timeout: 5s retries: 3 start_period: 10s - - redis: - image: redis:7-alpine - ports: - - "6379:6379" - volumes: - - redis_data:/data - restart: unless-stopped - command: ["redis-server", "--maxmemory", "192mb", "--maxmemory-policy", "allkeys-lru"] - deploy: - resources: - limits: - cpus: "0.25" - memory: 256M - reservations: - cpus: "0.1" - memory: 64M - healthcheck: - test: ["CMD", "redis-cli", "ping"] - interval: 10s - timeout: 3s - retries: 3 - -volumes: - redis_data: diff --git a/src/__tests__/container-resources.test.ts b/src/__tests__/container-resources.test.ts index 893357f..bed772d 100644 --- a/src/__tests__/container-resources.test.ts +++ b/src/__tests__/container-resources.test.ts @@ -110,23 +110,6 @@ describe("container resource limits (#225)", () => { }); }); - describe("redis service", () => { - it("declares memory and CPU limits", () => { - const limits = limitsFor("redis"); - expect(toBytes(limits.memory!)).toBeGreaterThan(0); - expect(Number(limits.cpus)).toBeGreaterThan(0); - }); - - it("caps its own memory below the container limit and evicts", () => { - const command = (compose.services.redis.command ?? []).join(" "); - expect(command).toMatch(/--maxmemory\s+\d+mb/); - expect(command).toMatch(/allkeys-lru/); - - const maxMemoryMb = Number(/--maxmemory (\d+)mb/.exec(command)![1]); - expect(maxMemoryMb * MB).toBeLessThan(toBytes(limitsFor("redis").memory!)); - }); - }); - describe("documentation", () => { const docPath = path.join(ROOT, "docs", "DEPLOYMENT.md");