Connect ECONNREFUSED server_1 docker compose localhost while executing API

Viewed 57

docker-compose.yml file and try to communicate with other services localhost but connection refused while executing API getting error of Error: connect ECONNREFUSED 127.0.0.1:3005

version: '3.9'
services:
  gateway:
    image: servicelayernode_gateway
    build:
      context: ./servicelayernode_gateway //context to 
      dockerfile: ./servicelayernode_gateway/Dockerfile
    ports:
      - 3001:3001
    environment:
      TZ: America/Toronto
      NODE_TLS_REJECT_UNAUTHORIZED: 0
      FLASK_ENV: development
      DOCKER_HOST: http://127.0.0.1:3001
      URL: http://localhost:3001
  ems:
    image: servicelayernode_service_ems
    build:
      context: ./servicelayernode_gateway
      dockerfile: ./servicelayernode_service_ems/Dockerfile
    ports:
      - 3005:3005
    depends_on:
      - gateway
    environment:
      TZ: America/Toronto
      NODE_TLS_REJECT_UNAUTHORIZED: 0
      FLASK_ENV: development
      URL: http://localhost:3005
    link: gateway
networks:
  default:
    # Use a custom driver
    driver: bridge

 

0 Answers
Related