I faced the same problem, many thanks to Michael Böckling for the answer, but for me it was not the final solution, besides that I made some changes, maybe it will be useful for someone
version: '3.8'
services:
app:
...
environment:
- REDIS_URL=redis://:@redis-cluster:6379/0
depends_on:
redis-cluster:
condition: service_started
redis-cluster:
image: docker.io/bitnami/redis-cluster:7.0
environment:
- 'ALLOW_EMPTY_PASSWORD=yes'
- 'REDIS_CLUSTER_REPLICAS=0'
- 'REDIS_NODES=redis-cluster redis-cluster redis-cluster'
- 'REDIS_CLUSTER_CREATOR=yes'
- 'REDIS_CLUSTER_DYNAMIC_IPS=no'
- 'REDIS_CLUSTER_ANNOUNCE_IP=redis-cluster'
ports:
- '6379:6379'