Skip to content

Commit a362f84

Browse files
authored
Update docker file to use redis/redis-stack (#20)
1 parent e057aea commit a362f84

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,22 @@ There is a `docker-compose-redis-only.yml` file in the root of this repository
8181
that you can use to start a Redis server locally. Just run:
8282

8383
```bash
84-
docker compose -f docker-compose-redis-only.yml u
84+
docker compose -f docker-compose-redis-only.yml up -d
8585
```
8686

87-
This will start a Redis server on `localhost:6379`, without any password.
87+
This will spin up a Redis server on `localhost:6379`, without any password,
88+
running in the background. You can stop it with:
89+
90+
```bash
91+
docker compose -f docker-compose-redis-only.yml down
92+
```
93+
94+
The image is based on
95+
[redis/redis-stack](https://redis.io/docs/install/install-stack/docker/) so also
96+
includes [RedisInsight](https://redis.io/docs/connect/insight/) running on port
97+
`8001` that you can use to inspect the Redis server.
98+
99+
**Note that this is a development server and should not be used in production.**
88100

89101
### Initialize Redis in your FastAPI application
90102

docker-compose-redis-only.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
version: "3.8"
21
services:
32
cache:
4-
image: redis:7.2-alpine
3+
image: redis/redis-stack:latest
54
restart: always
65
ports:
76
- "6379:6379"
8-
command: redis-server --save 20 1
7+
- "8001:8001"
98
volumes:
109
- cache:/data
1110
volumes:

0 commit comments

Comments
 (0)