dapr icon indicating copy to clipboard operation
dapr copied to clipboard

Containerized app with Dapr sidecar are unreachable from host machine

Open CChenelFlo opened this issue 1 year ago • 1 comments

here is my docker-compose file :

services:
  mockserver:
    image: "docker.io/mockserver/mockserver:latest"
    environment:
      MOCKSERVER_LOG_LEVEL: DEBUG
    ports:
      - "1080:1080"

  dapr:
    image: "daprio/daprd:1.13.2"
    command: [
      "./daprd",
      "-app-id", "mockserver-service",
      "-app-port", "1080",
      "-dapr-http-port", "3500",
      "-dapr-grpc-port", "50001",
    ]
    ports:
      - "3602:3602"
      - "6002:6002"
    network_mode: "container:mockserver" 
    environment:
      DAPR_LOG_LEVEL: "debug"
      PORT: "1080"
    depends_on:
      - mockserver

How can I reach the dapr sidecar from my host machine running another app in debug ? I am unable to make service invocation and the app running in the container isn't visible in the daprdashboard.

It looks like a catch 22. It's impossible to reach a sidecar if it is containerized. I tried to use bridge network but i won't work if I use the network_mode. If I don't use the network_mode, dapr is hanging because it can't "discover" the app.

CChenelFlo avatar Oct 15 '24 18:10 CChenelFlo

@CChenelFlo

This should help https://docs.dapr.io/developing-applications/debugging/debugging-docker-compose/#composedebugyml

p.s. I wrote this article, so happy to help

olitomlinson avatar Oct 16 '24 09:10 olitomlinson

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

dapr-bot avatar Dec 15 '24 09:12 dapr-bot

This issue has been automatically closed because it has not had activity in the last 67 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.

dapr-bot avatar Dec 22 '24 09:12 dapr-bot