专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

hiett/serverless-redis-http Docker 镜像 - 轩辕镜像

serverless-redis-http
hiett/serverless-redis-http
HTTP-based Redis pooler. Access Redis from serverless without overloading connection limits!
0 次下载
💣 CI/CD 卡在拉镜像?问题不在代码,在镜像源
镜像简介版本下载
💣 CI/CD 卡在拉镜像?问题不在代码,在镜像源

Serverless Redis HTTP (SRH)

A Redis proxy and connection pooler that uses HTTP rather than the Redis binary protocol.
The aim of this project is to be entirely compatible with Upstash, and work with any Upstash supported Redis version.

Use cases for SRH:

  • For usage in your CI pipelines, creating Upstash databases is tedious, or you have lots of parallel runs.
    • See Using in GitHub Actions on how to quickly get SRH setup for this context.
  • For usage inside of Kubernetes, or any network whereby the Redis server is not exposed to the internet.
    • See Using in Docker Compose for the various setup options directly using the Docker Container.
  • For local development environments, where you have a local Redis server running, or require offline access.
    • See Using the Docker Command, or Using Docker Compose.

Differences between Upstash and Redis to note

SRH tests are ran nightly against the @upstash/redis JavaScript package. However, there are some minor differences between Upstash's implementation of Redis and the official Redis code.

  • The UNLINK command will not throw an error when 0 keys are given to it. In Redis, and as such SRH, an error will be thrown.
  • In the ZRANGE command, in Upstash you are not required to provide BYSCORE or BYLEX in order to use the LIMIT argument. With Redis/SRH, this will throw an error if not provided.
  • The Upstash implementation of RedisJSON contains a number of subtle differences in what is returned in responses. For this reason, it is not advisable to use SRH with Redis Stack if you are testing your Upstash implementation that uses JSON commands. If you don't use any JSON commands, then all is good :)
  • SRH does not implement commands via paths, or accepting the token via a query param. Only the body method is implemented, which the @upstash/redis SDK uses.
Similarities to note:

Pipelines and Transaction endpoints are also implemented, also using the body data only. You can read more about the RestAPI here: Upstash Docs on the Rest API

Response encoding is also fully implemented. This is enabled by default by the @upstash/redis SDK. You can read more about that here: Upstash Docs on Hashed Responses

How to use with the @upstash/redis SDK

Simply set the REST URL and token to where the SRH instance is running. For example:

ts
import {Redis} from '@upstash/redis';
export const redis = new Redis({
    url: "http://localhost:8079",
    token: "example_token",
});

Setting up SRH

Via Docker command

If you have a locally running Redis server, you can simply start an SRH container that connects to it. In this example, SRH will be running on port 8080.

bash
docker run \
    -it -d -p 8080:80 --name srh \
    -e SRH_MODE=env \
    -e SRH_TOKEN=your_token_here \
    -e SRH_CONNECTION_STRING="redis://your_server_here:6379" \
    hiett/serverless-redis-http:latest

Via Docker Compose

If you wish to run in Kubernetes, this should contain all the basics would need to set that up. However, be sure to read the Configuration Options, because you can create a setup whereby multiple Redis servers are proxied.

yml
version: '3'
services:
  redis:
    image: redis
    ports:
      - '6379:6379'
  serverless-redis-http:
    ports:
      - '8079:80'
    image: hiett/serverless-redis-http:latest
    environment:
      SRH_MODE: env
      SRH_TOKEN: example_token
      SRH_CONNECTION_STRING: 'redis://redis:6379' # Using `redis` hostname since they're in the same Docker network.

In GitHub Actions

SRH works nicely in GitHub Actions because you can run it as a container in a job's services. Simply start a Redis server, and then SRH alongside it. You don't need to worry about a race condition of the Redis instance not being ready, because SRH doesn't create a Redis connection until the first command comes in.

yml
name: Test @upstash/redis compatability
on:
  push:
  workflow_dispatch:
env:
  SRH_TOKEN: example_token
jobs:
  container-job:
    runs-on: ubuntu-latest
    container: denoland/deno
    services:
      redis:
        image: redis/redis-stack-server:6.2.6-v6 # 6.2 is the Upstash compatible Redis version
      srh:
        image: hiett/serverless-redis-http:latest
        env:
          SRH_MODE: env # We are using env mode because we are only connecting to one server.
          SRH_TOKEN: ${{ env.SRH_TOKEN }}
          SRH_CONNECTION_STRING: redis://redis:6379
    steps:
      # You can place your normal testing steps here. In this example, we are running SRH against the upstash/upstash-redis test suite.
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          repository: upstash/upstash-redis
      - name: Run @upstash/redis Test Suite
        run: deno test -A ./pkg
        env:
          UPSTASH_REDIS_REST_URL: [***]
          UPSTASH_REDIS_REST_TOKEN: ${{ env.SRH_TOKEN }}

Configuration Options

SRH works with multiple Redis servers, and can pool however many connections you wish it to. It will shut down un-used pools after 15 minutes of inactivity. Upon the next command, it will re-build the pool.

Connecting to multiple Redis servers at the same time

The examples above use environment variables in order to tell SRH which Redis server to connect to. However, you can also use a configuration JSON file, which lets you create as many connections as you wish. The token provided in each request will decide which pool is used.

Create a JSON file, in this example called tokens.json:

json
{
    "example_token": {
        "srh_id": "some_unique_identifier",
        "connection_string": "redis://localhost:6379",
        "max_connections": 3
    }
}

You can provide as many entries to the base object as you wish, and configure the number of max connections per pool. The srh_id is used internally to keep track of instances. It can be anything you want.

Once you have created this, mount it to the docker container to the /app/srh-config/tokens.json file. Here is an example docker command:

docker run -it -d -p 8079:80 --name srh --mount type=bind,source=$(pwd)/tokens.json,target=/app/srh-config/tokens.json hiett/serverless-redis-http:latest

Environment Variables

NameDefault ValueNotes
SRH_MODEfileCan be env or file. If file, see Connecting to multiple Redis servers. If set to env, you are required to provide the following environment variables:
SRH_TOKEN<required if SRH_MODE = env>Set the token that the Rest API will require
SRH_CONNECTION_STRING<required if SRH_MODE = env>Sets the connection string to the Redis server.
SRH_MAX_CONNECTIONS3Only used if SRH_MODE=env.
查看更多 serverless-redis-http 相关镜像 →
redis/redis-stack logo
redis/redis-stack
Redis Stack是一个集成方案,它安装Redis服务器并赋予其额外的数据库功能,如搜索、JSON数据处理、时间序列管理等,同时包含RedisInsight这一可视化管理工具,帮助用户便捷部署、监控和管理Redis数据库,有效提升开发与运维效率。
15910M+ pulls
上次更新:未知
redis/redis-stack-server logo
redis/redis-stack-server
redis-stack-server是一款用于安装Redis服务器的工具,它在标准Redis服务器的基础上,集成了多种额外的数据库功能,包括对JSON数据类型的原生支持、高效的全文搜索能力、时间序列数据的专门管理机制以及概率数据结构(如布隆过滤器)等,这些扩展功能显著增强了Redis的数据处理多样性和应用灵活性,使其能够更好地满足实时数据分析、内容检索、多模型数据存储等复杂场景的需求。
10010M+ pulls
上次更新:未知
redislabs/redis logo
redislabs/redis
Redis Labs提供的集群化内存数据库引擎,完全兼容开源Redis,具备企业级特性,支持高性能、零停机线性扩展和高可用性,适用于分布式应用场景。
4450M+ pulls
上次更新:未知
redis/redisinsight logo
redis/redisinsight
Redis Insight 是 Redis 官方推出的最佳图形用户界面(GUI)工具,它集数据结构可视化浏览与编辑、实时性能监控、集群管理、问题诊断及开发调试等功能于一体,能够帮助开发者和管理员更高效地操作与维护 Redis 数据库,凭借官方出品的可靠性和专业性,成为 Redis 生态中简化日常管理、提升工作效率的不可或缺的利器。
471M+ pulls
上次更新:未知
redislabs/redisinsight logo
redislabs/redisinsight
RedisInsight是Redis的官方图形用户界面(GUI)工具,支持可视化浏览和管理Redis数据库中的键值数据,提供直观的命令执行界面、实时性能监控图表、集群节点状态查看、数据导入导出及配置管理等功能,帮助开发者和运维人员更高效地操作和维护Redis实例,简化复杂数据结构的管理流程,提升工作效率。
11610M+ pulls
上次更新:未知
redislabs/redismod logo
redislabs/redismod
An automated build of redismod - latest Redis with select modules.
511M+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
hiett/serverless-redis-http
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.