zero-to-production
zero-to-production copied to clipboard
Local docker container error
Hello,
Attempting to run the container locally fails to connect to the local Redis container initialized with init_redis.sh. The error returned is Error: Could not connect to Redis database
Caused by: Connection refused (os error 111)
The application runs fine locally when not in a container.
This is most likely an issue related to how the Docker networking is setup on your machine 🤔
I managed to get this working by using the name of the redis container in the URI instead of 127.0.0.1.
I'm currently passing that to my app instances using the environment variable config override:
APP_REDIS_URI="redis://<REDIS_CONTAINER_NAME>:6379"