Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Connects with 127.0.0.1 instead of host parameter value when running in a container. #30

Closed
chainhead opened this issue Sep 15, 2019 · 3 comments

Comments

@chainhead
Copy link

I am running my container as follows:

docker run --rm -p 80:3001 -it $(pwd)/conf/server.json:/app/conf/server.json -v $(pwd)/conf/redis.json:/app/conf/redis.json username/reponame:tag

Before making the connection, the options object for Redis connection does have the values as defined in $(pwd)/conf/redis.json. The connection fails with the following error.

Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379

How to get around this problem?

@silverbucket
Copy link
Owner

Could you reduce this down to something outside of docker? Too many factors to consider.

@silverbucket
Copy link
Owner

At first glance it looks like your docker instance is unable to connect to redis.

@silverbucket
Copy link
Owner

#29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants