修复docker-compose.yml: 完全注释Redis服务避免语法错误
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:15:54 +08:00
parent 8d1e58cdac
commit 7a7fa577fa

View File

@@ -160,38 +160,29 @@ services:
# ===========================================================================
# Redis Cache (DISABLED - Using external Redis at 172.18.0.2:6379)
# ===========================================================================
# Uncomment below if you want to use the built-in Redis instead of external
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 is used by redis-cli for authentication (safer than -a flag)
- REDISCLI_AUTH=${REDIS_PASSWORD:-}
networks:
- sub2api-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# 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
# =============================================================================
# Volumes