dapr / dashboard

General purpose dashboard for Dapr
Apache License 2.0
181 stars 47 forks source link

Missing Dapr Applications in the dashboard if we use env_file in docker compose #275

Open valentin-pouget-forge opened 3 months ago

valentin-pouget-forge commented 3 months ago

Expected Behavior

I would expect the dashboard to display all the Dapr Applications in the Overview.

Actual Behavior

Given I run the dashboard using the docker compose = true When any of my other service (simple dotnet app) uses the env_file: property Then the dashboard would show an empty Dapr Applications in the Overview page.

Steps to Reproduce the Problem

Create a simple docker compose file with one service and

MyService:
    image: ${REGISTRY:-r}/myservice:${TAG:-latest}
    build:
      context: .
      dockerfile: src/MyService/Dockerfile.local
    env_file:
      - ${HOST_WORKSPACE_PATH}/infra/dapr/envs/var-features.env

, one dapr sidecar based on image: "daprio/daprd:latest" with

  MyService-dapr:
    image: "daprio/daprd:latest"
    network_mode: "service:MyService"
    command:
      [
        "./daprd",
        "-app-id",
        "myservice",
        "-app-port",
        "80",
        "-resources-path",
        "/components",
        "-config",
        "/configuration/broker-platform-config.yaml",
        "--log-as-json",
        "true",
      ]

, and one dashboard with image: "daprio/dashboard:latest" and

   dapr-dashboard:
    image: "daprio/dashboard:latest"
   command:
      [
        "--docker-compose=true",
        "--components-path=/components",
        "--config-path=/configuration",
        "--docker-compose-path=/home/nonroot/docker-compose.yml",
      ]
      volumes:
      - "${HOST_WORKSPACE_PATH}/docker-compose.yml:/home/nonroot/docker-compose.yml"
      - "${HOST_WORKSPACE_PATH}/infra/dapr/components/:/components"
      - "${HOST_WORKSPACE_PATH}/infra/dapr/configuration/:/configuration"

Then if we open the logs for the dashboard, we can observe this line, even though the image for the dashboard should not load the .env files: 024/07/08 09:43:57 Failed to load /infra/dapr/envs/var-features.env: open /infra/dapr/envs/var-features.env: no such file or directory

Release Note

FIX env_file to be use for another service does not break initialization of the dashboard.