services:
  redis:
    image: bitnami/redis:6.2.11
    ports:
      - ${REDISCLI_PORT:?err}:6379
    environment:
      - "ALLOW_EMPTY_PASSWORD=yes"
      - "REDIS_PASSWORD=bitnami"
    command:
      - bash
      - "-c"
      - |
        /opt/bitnami/scripts/redis/run.sh \
          --appendonly yes \
          --auto-aof-rewrite-percentage 100 \
          --auto-aof-rewrite-min-size 104857600 \
          --maxclients 40000 \
          --loglevel warning
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 1s
      timeout: 20s
      retries: 10
