For node backend development on windows I am trying to setup redis in a docker container as the redis windows version seems to be buggy for me. I am very new to docker and I am not aware of all the principles coming along with it.
What I have done so far:
- Installed docker
- Run 'docker pull redis'
- Run 'docker run --name some-redis -d redis redis-server --appendonly yes' to start the redis container
The problem:
I tried connecting to 127.0.0.1:6379 (which used to work when I had redis installed natively on my system), but it is timeouting. I thought that the redis container has it's own ip address and I figured it's ip addres sis 172.17.0.2. Connecting to this ip didn't work either though.
PS C:\WINDOWS\system32> docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' some-redis
172.17.0.2
PS C:\WINDOWS\system32> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d3b796e9df5c redis "docker-entrypoint..." About an hour ago Up 8 minutes 6379/tcp some-redis
What am I missing in order to connect from my local machine to redis inside of my container? (My node application is not dockerized)