I have a docker-compose yml file as in below
version: \'2\' services: nodejs: build: context: . doc
If you want to access redis from the host (127.0.0.1), you have to use the ports command.
redis
ports
redis: build: context: . dockerfile: Dockerfile-redis ports: - "6379:6379"