Django won't connect to Redis Docker container

时间:2018-02-26 17:43:07

标签: django docker redis

I've spent forever trying to connect my Django container to Redis while using Docker-Compose. After hours of changing Docker and Django configs and trying different ways to run everything, I finally figured out that Redis was broadcasting to the host.

These were the errors I was getting each try:

  • Error 111 connecting to 0.0.0.0:6379. Connection refused.
  • Error 61 connecting to localhost:6379. Connection refused.
  • Error 111 connecting to 127.0.0.1:6379. Connection refused.

I finally ended up changing the Django IP config for Redis to the Docker host IP and it worked just fine...

Does anyone know of a way to configure everything so that Django looks for Redis on the internal Docker network rather than the external host?

FYI - I'm a total noob.

0 个答案:

没有答案