Spaces:
Sleeping
Sleeping
hiett
commited on
Commit
·
1d88912
1
Parent(s):
40d9f07
0.0.5-alpha candidate, changes to use that and the new environment config mode
Browse files- .github/workflows/test.yml +6 -4
- HOW_TO_BUILD.md +7 -0
- example/src/index.ts +1 -1
.github/workflows/test.yml
CHANGED
|
@@ -9,13 +9,15 @@ jobs:
|
|
| 9 |
container: node:18
|
| 10 |
services:
|
| 11 |
redis:
|
| 12 |
-
image: redis
|
| 13 |
ports:
|
| 14 |
- 6379:6379
|
| 15 |
srh:
|
| 16 |
-
image: hiett/serverless-redis-http:
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
ports:
|
| 20 |
- 8080:80
|
| 21 |
|
|
|
|
| 9 |
container: node:18
|
| 10 |
services:
|
| 11 |
redis:
|
| 12 |
+
image: redis:6.2 # 6.2 is the Upstash compatible Redis version
|
| 13 |
ports:
|
| 14 |
- 6379:6379
|
| 15 |
srh:
|
| 16 |
+
image: hiett/serverless-redis-http:0.0.5-alpha
|
| 17 |
+
environment:
|
| 18 |
+
SRH_MODE: env
|
| 19 |
+
SRH_TOKEN: example_token
|
| 20 |
+
SRH_CONNECTION_STRING: redis://redis:6379
|
| 21 |
ports:
|
| 22 |
- 8080:80
|
| 23 |
|
HOW_TO_BUILD.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Building the Docker image
|
| 2 |
+
|
| 3 |
+
To build both an amd64 image and an arm64 image, on an M1 Mac:
|
| 4 |
+
|
| 5 |
+
```
|
| 6 |
+
docker buildx build --platform linux/amd64,linux/arm64 --push -t hiett/serverless-redis-http:0.0.5-alpha
|
| 7 |
+
```
|
example/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import {Redis} from "@upstash/redis";
|
| 2 |
|
| 3 |
const redis = new Redis({
|
| 4 |
-
url: "http://
|
| 5 |
token: "example_token",
|
| 6 |
responseEncoding: false,
|
| 7 |
});
|
|
|
|
| 1 |
import {Redis} from "@upstash/redis";
|
| 2 |
|
| 3 |
const redis = new Redis({
|
| 4 |
+
url: "http://srh:8080",
|
| 5 |
token: "example_token",
|
| 6 |
responseEncoding: false,
|
| 7 |
});
|