|
@@ -42,7 +42,7 @@ services:
|
|
|
image: 'redis:latest' # 使用最新版本的 Redis 镜像,也可以指定特定版本如 'redis:6.2.7'
|
|
image: 'redis:latest' # 使用最新版本的 Redis 镜像,也可以指定特定版本如 'redis:6.2.7'
|
|
|
container_name: my-redis # 自定义容器名称
|
|
container_name: my-redis # 自定义容器名称
|
|
|
ports:
|
|
ports:
|
|
|
- - '5379:6379' # 映射宿主机的 6379 端口到容器的 6379 端口
|
|
|
|
|
|
|
+ - '6379:6379' # 映射宿主机的 6379 端口到容器的 6379 端口
|
|
|
volumes: # 持久化数据
|
|
volumes: # 持久化数据
|
|
|
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
|
|
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
|
|
|
- ./redis/data:/data:rw
|
|
- ./redis/data:/data:rw
|