Documentation

Redis Cache & Queues

Configure the in-memory Redis data store utilized by nLink for high-speed caching and background job processing.

Docker Compose Blueprint

Redis acts as the backbone for temporary data flow states and caching mechanisms in the nLink backend. The recommended configuration deploys a lightweight Alpine image with password protection.

  redis_server:
    image: redis:alpine
    restart: always
    command: redis-server --requirepass 123456
    volumes:
      - redis_data:/data

volumes:
  redis_data:

Configuration Details

  • Engine Version: redis:alpine
    (The smallest and fastest memory-footprint container image).
  • Security: --requirepass 123456
    (By default, the compose file overrides the generic Redis boot command to inject a password. In production, change 123456 to a robust secret).
  • Port Mapping: 6380:6379
    (The container runs natively on 6379, but is exposed to your host machine on 6380 to prevent conflicts if you already have a local Redis instance).
  • Volume Persistence: redis_data
    (Maps the internal /data directory, ensuring job buffers persist across container restarts).

Environment Integration

To let the backend connect to this Redis container, ensure the variables match correctly in your `.env` or compose file:

  nlink:
    environment:
      - REDIS_ADDR=redis_server:6379 
      - REDIS_PASSWORD=123456
      - REDIS_DB=8