'Problem running DAPR with docker-compose in ASP .NET core 3.1

I'm trying to run multiple microservices with docker-compose relying on DAPR to establish communication between them. However, even though developer shell logs say that DAPR sidecars are up and running I can't see them in DAPR dashboard and can't invoke methods using them.

I've followed instructions from https://docs.microsoft.com/en-us/dotnet/architecture/dapr-for-net-developers/getting-started and google quite a bit but can't find the problem.

I've also verified that DAPR is correctly installed by running the aforementioned Microsoft example successfully getting expected results.

Here is my docker-compose.yml file

version: '3.4'

services:
  antivirus:
    image: mkodockx/docker-clamav:alpine

  users-db:
    image: mcr.microsoft.com/mssql/server
    ports:
      - "1401:1433"
    environment:
      ACCEPT_EULA: "Y"
      SA_PASSWORD: "Your+password123"

  physical-db:
    image: mcr.microsoft.com/mssql/server
    ports:
      - "1402:1433"
    environment:
      ACCEPT_EULA: "Y"
      SA_PASSWORD: "Your+password123"


  smartenergy.users:
    image: ${DOCKER_REGISTRY-}smartenergyusers
    build:
      context: .
      dockerfile: SmartEnergy.Users/Dockerfile
    ports:
      - "6969:80"
      - "44372:443"
    depends_on:
      - users-db

  smartenergy.users-dapr:
    image: "daprio/daprd:latest"
    command: [ "./daprd", "-app-id", "smartenergyusers", "-dapr-http-port", "3500",  "-app-port", "443", "-app-ssl" ]
    depends_on:
      - smartenergy.users
    network_mode: "service:smartenergy.users"


  smartenergy.physical:
    image: ${DOCKER_REGISTRY-}smartenergyphysical
    build:
      context: .
      dockerfile: SmartEnergy.Physical/Dockerfile
    ports:
      - "6970:80"
      - "44373:443"
    depends_on:
      - physical-db


  smartenergy.physical-dapr:
    image: "daprio/daprd:latest"
    command: [ "./daprd", "-app-id", "smartenergyphysical", "-dapr-http-port", "3501", "-app-port", "443", "-app-ssl" ]
    depends_on:
      - smartenergy.physical
    network_mode: "service:smartenergy.physical"

Here is DAPR log file

time="2021-06-14T12:37:02.5979749Z" level=info msg="application discovered on port 443" app_id=smartenergyphysical instance=307796672fab scope=dapr.runtime type=log ver=1.2.0

time="2021-06-14T12:37:09.8308681Z" level=info msg="application configuration loaded" app_id=smartenergyphysical instance=307796672fab scope=dapr.runtime type=log ver=1.2.0

time="2021-06-14T12:37:09.8570903Z" level=warning msg="failed to init actors: actors: couldn't connect to placement service: address is empty" app_id=smartenergyphysical instance=307796672fab scope=dapr.runtime type=log ver=1.2.0

time="2021-06-14T12:37:09.8592054Z" level=info msg="dapr initialized. Status: Running. Init Elapsed 18699.5997ms" app_id=smartenergyphysical instance=307796672fab scope=dapr.runtime type=log ver=1.2.0

I've verified that both microservices are running, along with MSSQL containers. But trying to invoke a service using DAPR fails with no response. Calling api method from swagger UI work as expected, but DAPR doesn't even seem to be running.

Swagger UI

Invocation attempt

Does anyone know what the problem is?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source