Answer the question
In order to leave comments, you need to log in
How to connect two docker containers?
I created an authorization service and I want to connect to it through another service.
Tried to connect via addresses
auth_service:9101
auth:9101
localhost:9101
gives an error
Post \"http://auth_service:9101/api/v1/auth/sign-in\": dial tcp: lookup auth_service on 127.0.0.11:53: read udp 127.0.0.1:5989
5->127.0.0.11:53: i/o timeout
version: '3.4'
services:
app:
image: auth
container_name: auth
build:
context: .
dockerfile: Dockerfile
ports:
- 9101:9101
depends_on:
- postgresql
volumes:
- ./.bin/:/root/
- ./configs/:/root/configs/
env_file:
- .env
networks:
- auth_service
networks:
auth_service:
version: '3.4'
services:
app:
image: brocker
container_name: brocker
build:
context: .
dockerfile: Dockerfile
ports:
- 9100:9100
depends_on:
- pstgrsql
volumes:
- ./.bin/:/root/
- ./configs/:/root/configs/
env_file:
- .env
networks:
- brocker_service
networks:
brocker_service:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question