The root cause was that Celery was connected to the Redis server running directly on my Mac (outside Docker), while Redis Commander was configured to connect to the Redis instance running inside the Docker container. Since Celery used the host Redis, all the keys were stored there, but the Redis inside the container had none, so Redis Commander showed an empty database.
By changing the Redis Commander configuration to connect to the host Redis with:
REDIS_HOSTS=host:host.docker.internal:6379
Redis Commander could access the same Redis instance as Celery, making all keys visible.
In short: Docker containers have their own network environment. localhost
inside a container means the container itself, not your Mac. To connect a container to a service running on your Mac, use host.docker.internal
instead of localhost
or container hostnames.