I have a backend API and an identity manager service, each of them have a compose file. On every API request the code should communicate with the identity service (validate the JWT token), but it is on a different network. How should I configure the networks to reach each other?
version: "3.9"
services:
api:
build: .
ports:
- 5000:80
- 5001:443
depends_on:
- db
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionString=Server=db,1433;Database=test;User Id=sa;Password=${SQL_PASSWORD}
- JWTSettings__Issuer=${AUTH_ISSUER}
- JWTSettings__Authority=${AUTH_AUTHORITY}
- JWTSettings__Audience=${AUTH_AUDIENCE}
db:
image: mcr.microsoft.com/mssql/server
user: root
ports:
- 1433:1433
environment:
- SA_PASSWORD=${SQL_PASSWORD}
- ACCEPT_EULA="Y"
version: "3.9"
services:
auth:
image: quay.io/keycloak/keycloak
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
ports:
- 4000:8080