恢复Redis服务配置,使用兼容的command语法
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

This commit is contained in:
huangzhenpc
2026-01-15 21:17:06 +08:00
parent 7a7fa577fa
commit f0f88c7f97

View File

@@ -160,29 +160,40 @@ services:
# =========================================================================== # ===========================================================================
# Redis Cache (DISABLED - Using external Redis at 172.18.0.2:6379) # 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" # Built-in Redis is available but not used by default
# The application connects to external Redis at 172.18.0.2:6379
# redis: redis:
# image: redis:8-alpine profiles:
# container_name: sub2api-redis - disabled
# restart: unless-stopped image: redis:8-alpine
# ulimits: container_name: sub2api-redis
# nofile: restart: unless-stopped
# soft: 100000 ulimits:
# hard: 100000 nofile:
# volumes: soft: 100000
# - redis_data:/data hard: 100000
# command: redis-server --save 60 1 --appendonly yes --appendfsync everysec volumes:
# environment: - redis_data:/data
# - TZ=${TZ:-Asia/Shanghai} command:
# networks: - sh
# - sub2api-network - -c
# healthcheck: - |
# test: ["CMD", "redis-cli", "ping"] redis-server \
# interval: 10s --save 60 1 \
# timeout: 5s --appendonly yes \
# retries: 5 --appendfsync everysec \
# start_period: 5s $${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 # Volumes