services: redis: image: redis:7.0 container_name: redis restart: always ports: - "6379:6379" centrifugo: image: centrifugo/centrifugo:v5 container_name: centrifugo restart: always ports: - "8000:8000" # HTTP API - "8001:8001" # WebSocket volumes: - ./centrifugo.json:/centrifugo/config.json:ro command: centrifugo --config=/centrifugo/config.json healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8000/health"] interval: 10s timeout: 5s retries: 3 depends_on: - redis cassandra: image: cassandra:5.0.4 restart: always ports: - "9042:9042" environment: TZ: ${TIMEZONE:-UTC} MAX_HEAP_SIZE: 4G HEAP_NEWSIZE: 2G healthcheck: test: ["CMD", "cqlsh", "-k", "sccflex"] interval: 10s timeout: 10s retries: 12 mem_limit: 8g # <--- 單機 docker-compose up 時建議明確加這行 memswap_limit: 8g # <--- 關掉 swap