IDX20803: Unable to obtain configuration when dockerize project

228 Views Asked by At

I have 2 projects IdentityServer and bankAccount.api

identityServer address : https://localhost:5001
bankaccount address : http://localhost:5005

When the project runs outside of Docker, everything works fine and all endpoints in the bankaccount.api are executed using tokens received from identityserver Now when we run the projects in Docker, the following error appears

IDX20803: Unable to obtain configuration from:
'https://localhost:5001/.well-known/openid-configuration'.

Yml file settings:

      identityserver:
    container_name: identityserver
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - "ConnectionStrings:DefaultConnection=Server=sqlsrvdb;Database=IdentityDb;User Id=sa;Password=123456"
      - "Data:Seed=true"
      - ASPNETCORE_URLS=https://+:443
      - ASPNETCORE_HTTPS_PORT=5001
      - ASPNETCORE_Kestrel__Certificates__Default__Password=password
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/identityserver.pfx
    depends_on:
      - sqlsrvdb
    ports:
      - "5001:443"
    volumes:
      - ~/.aspnet/https:/https:ro

  bankaccount.api:
    container_name: bankaccount.api
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - "ConnectionStrings:DefaultConnection=Server=sqlsrvdb;Database=AccountDb;User Id=sa;Password=123456"
      - "GrpcSettings:CountryUrl=http://country.grpc"
      - "GrpcSettings:CustomerUrl=http://customer.grpc"
      - "GrpcSettings:CurrencyUrl=http://currency.grpc"
      - "GrpcSettings:WalletUrl=http://wallet.grpc"
      - "CacheSettings:ConnectionString=redisdb:6379"
      - "CacheSettings:InstanceName=bankaccount-redis"
      - "IdentityServer:Uri=https://identityserver"
    depends_on:
      - sqlsrvdb
    ports:
      - "5005:80"

If I just run the identityserver in Docker and the other project outside Docker still works properly

0

There are 0 best solutions below