恢复Redis服务配置,使用兼容的command语法
This commit is contained in:
@@ -160,29 +160,40 @@ services:
|
||||
# ===========================================================================
|
||||
# Redis Cache (DISABLED - Using external Redis at 172.18.0.2:6379)
|
||||
# ===========================================================================
|
||||
# To use built-in Redis instead, uncomment the service below and update REDIS_HOST to "redis"
|
||||
|
||||
# redis:
|
||||
# image: redis:8-alpine
|
||||
# container_name: sub2api-redis
|
||||
# restart: unless-stopped
|
||||
# ulimits:
|
||||
# nofile:
|
||||
# soft: 100000
|
||||
# hard: 100000
|
||||
# volumes:
|
||||
# - redis_data:/data
|
||||
# command: redis-server --save 60 1 --appendonly yes --appendfsync everysec
|
||||
# environment:
|
||||
# - TZ=${TZ:-Asia/Shanghai}
|
||||
# networks:
|
||||
# - sub2api-network
|
||||
# healthcheck:
|
||||
# test: ["CMD", "redis-cli", "ping"]
|
||||
# interval: 10s
|
||||
# timeout: 5s
|
||||
# retries: 5
|
||||
# start_period: 5s
|
||||
# Built-in Redis is available but not used by default
|
||||
# The application connects to external Redis at 172.18.0.2:6379
|
||||
redis:
|
||||
profiles:
|
||||
- disabled
|
||||
image: redis:8-alpine
|
||||
container_name: sub2api-redis
|
||||
restart: unless-stopped
|
||||
ulimits:
|
||||
nofile:
|
||||
soft: 100000
|
||||
hard: 100000
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
redis-server \
|
||||
--save 60 1 \
|
||||
--appendonly yes \
|
||||
--appendfsync everysec \
|
||||
$${REDIS_PASSWORD:+--requirepass "$$REDIS_PASSWORD"}
|
||||
environment:
|
||||
- TZ=$${TZ:-Asia/Shanghai}
|
||||
- REDISCLI_AUTH=$${REDIS_PASSWORD:-}
|
||||
networks:
|
||||
- sub2api-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 5s
|
||||
|
||||
# =============================================================================
|
||||
# Volumes
|
||||
|
||||
Reference in New Issue
Block a user