Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis doesn't connect with other image in docker #8

Open
DannyXY opened this issue Jan 2, 2023 · 0 comments
Open

Redis doesn't connect with other image in docker #8

DannyXY opened this issue Jan 2, 2023 · 0 comments

Comments

@DannyXY
Copy link

DannyXY commented Jan 2, 2023

Hello, so i'm trying to run redis side by side a NestJS API, dockerize it and run it in an AWS instance
I tested it locally with my redis and local system, it works fine
But whenever i run my docker-compose up, i get the ERRCONFUSED error 127.0.0.1:6379
But if i run the nestjs container outside docker, it connects to the dockerized redis
Here is my docker-compose file

version: '3.3'
services:
  redis: # Name of container
    image: redis:6.2-alpine
    command: ["redis-server", "--bind", "0.0.0.0", "--port", "6379"]
    container_name: redis
    restart: unless-stopped
    network_mode: nebula
    expose:
      - 6379
    ports:
      - 6379:6379
  prod:
    container_name: ad-promoter-api-new-d
    image: ad-promoter-redis-prod-new-d:1.0.0
    build:
      context: .
      dockerfile: ./Dockerfile
      target: prod
    command: npm run start:prod
    ports:
      - 80:80
    network_mode: nebula
    links:
      - redis
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    restart: unless-stopped

Any help at all is appreciated

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

No branches or pull requests

1 participant