Files
dsas-cca-backend-bun/docker-compose.yaml
JamesFlare1212 32dee6b161 fix(cache): resolve scanning stop issue and add cache TTL management
- Fix Redis SCAN cursor type conversion (Buffer to String) to prevent early termination
- Add progress logging in initializeClubCache (every 100 activities with summary)
- Add Redis memory limits (512MB with LRU eviction policy)
- Implement cache TTL: 24h for normal data, 1h for error states (allows retry)
- Fix Docker permission issue by running app container as root
- Add TTL configuration to .env and example.env

Root cause: SCAN cursor comparison failed due to type mismatch (Buffer vs String)
Impact: Scanning now processes all 5000+ IDs instead of stopping at ~300
2026-04-06 21:03:30 -04:00

78 lines
1.9 KiB
YAML

services:
warp-proxy:
image: ghcr.io/mon-ius/docker-warp-socks:v5
container_name: dsas-cca-warp-proxy
restart: unless-stopped
ports:
- "9091:9091"
networks:
- cca_network
logging:
driver: "json-file"
options:
max-size: "15m"
max-file: "3"
app:
build:
context: .
dockerfile: Dockerfile
container_name: dsas-cca-backend
# Run as root to allow writing to volume-mounted cookies.json
# Alternative: Use named volume instead of bind mount
user: "0:0"
ports:
- "${PORT:-3000}:${PORT:-3000}"
env_file:
- .env
environment:
- NODE_ENV=production
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
# Proxy configuration (only active when USE_PROXY=true)
- USE_PROXY=${USE_PROXY:-false}
- HTTP_PROXY=${HTTP_PROXY:-}
- HTTPS_PROXY=${HTTPS_PROXY:-}
- ALL_PROXY=${ALL_PROXY:-}
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
warp-proxy:
condition: service_started
volumes:
- ./services/cookies.json:/usr/src/app/services/cookies.json
networks:
- cca_network
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "15m"
max-file: "3"
redis:
image: "redis:8.0-alpine"
container_name: dsas-cca-redis
# Add memory limits to prevent OOM
command: redis-server --requirepass "dsas-cca" --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ./redis_data:/data
restart: unless-stopped
networks:
- cca_network
healthcheck:
test: ["CMD", "redis-cli", "-a", "dsas-cca", "ping"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "json-file"
options:
max-size: "15m"
max-file: "3"
networks:
cca_network:
driver: bridge