Dovresti cambiare :
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('0.0.0.0', 6379)],
},
},
}
a
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('redis', 6379)],
},
},
}
nel tuo Django settings file .
Quando imposti i contenitori da compose, sono tutti connessi alla rete predefinita creata da compose. redis è in questo caso il nome DNS di redis container e verrà risolto automaticamente in container ip