Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
redis.createClient() doesn't work in docker

I want to use redis-image in docker-hub.

so, i make docker-compose.yml file like this

version: "3.7"

services:
  backend:
    container_name: test-server
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ".:/app"
      - "/app/node_modules"
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=development
    stdin_open: true
    tty: true
    depends_on:
      - redis
  redis:
      image: redis
      command: redis-server --port 6379
      container_name: redis
      hostname: redis
      labels:
        - "name=redis"
        - "mode=standalone"
      ports:
        - 6379:6379

For docker internal connection, I found some few answers in stackoverflow

fail to link redis container to node.js container in docker

so, I redis.createClient("redis://0.0.0.0:6739"); like this

when, I build docker image. and run docker

In this container Error Error: connect ECONNREFUSED 127.0.0.1:6379

Initially, I think the url error, but i change to redis://localhost:6378(just change port)

I got same error, like this Error Error: connect ECONNREFUSED 127.0.0.1:6379

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!