forked from DevOps/deploy.stack
fix(redis): 添加Redis密码认证并配置Valkey环境变量
为Redis服务添加密码认证参数,同时为Valkey服务配置包括密码、端口、数据库、内存限制等环境变量,增强服务安全性及可配置性
This commit is contained in:
@@ -7,7 +7,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '6379:6379'
|
- '6379:6379'
|
||||||
command: redis-server --appendonly yes
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- '${Volumes_PATH}/redis:/data'
|
- '${Volumes_PATH}/redis:/data'
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -9,4 +9,10 @@ services:
|
|||||||
- '6379:6379'
|
- '6379:6379'
|
||||||
command: valkey-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
command: valkey-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- '${Volumes_PATH}/redis:/data'
|
- '${Volumes_PATH}/redis:/data'
|
||||||
|
environment:
|
||||||
|
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- REDIS_DB=1
|
||||||
|
- REDIS_MAXMEMORY=1gb
|
||||||
|
- REDIS_MAXMEMORYPOLICY=allkeys-lru
|
||||||
Reference in New Issue
Block a user