This docker-compose.yml works fine:
version: '3' services: web: image: web-app command: bundle exec rackup ports: - "9292:9292" links: - redis redis: image: redis
Command:
docker build -t web-app .; docker-compose up
The web application is waiting for the REDIS_URL configuration. Dockerfile web application:
ENV REDIS_URL redis:6379
It seems that the web application cannot connect to Redis:
Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED):
So what is a Redis URL for a web application?
Do I need to open a Redis port (6379)?
EDIT:
Thanks to @Andy Shinn, I see that redis url should be redis://6379 .
Now I get Errno::EINVAL - Invalid argument - connect(2) for 0.0.24.235:6379 . This may be relevant to Redis v 3.2.8. I will try a different version and see if it works.
EDIT # 2:
3.2.8 works great with the application on my local machine, so this is not a problem.
source share