rails + docker + sidekiq + Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)

前端 未结 2 2135
情深已故
情深已故 2021-02-14 05:18

I am getting this error while running my rails app with docker and docker-compose Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)

Please find my Docker

2条回答
  •  星月不相逢
    2021-02-14 05:36

    Links are not required to enable services to communicate - by default, any service can reach any other service at that service’s name.

    According to your docker-compose.yaml file you can access you redis container on 127.0.0.1:6379 only from host machine.

    Containers communicate with each other in their network, so you can access your redis container on redis:6379 from rails app container.

提交回复
热议问题