dapr / samples

Community driven repository for Dapr samples
Apache License 2.0
416 stars 174 forks source link

Documentation error? #73

Closed farhadnowzari closed 3 years ago

farhadnowzari commented 3 years ago

Hi,

Recently we have decided to give dapr a try with our microservices. Yesterday when I started to test with docker the following config was strange to me, the -app-port config on the sidecards looks wrong. Shouldn't it be listening to what the actual app is listening too (It is the same as the cli right? https://docs.dapr.io/reference/cli/dapr-run/)?

I am setting it up with redis pubsub and two dotnet core webapis and with following this config I couldn't get it to work so I change the -app-port from 3000 to the port my app was really listening too and it worked. But I think maybe its because in your case it is gRPC? I'm not sure.

But thanks for the documentation anyway at least it is there in most cases its not for other libraries/packages. 😊

version: '3'
services:
  ############################
  # Node app + Dapr sidecar
  ############################
  nodeapp:
    build: ./node
    ports:
      - "50002:50002"
    depends_on:
      - redis
      - placement
    networks:
      - hello-dapr
  nodeapp-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
     "-app-id", "nodeapp",
     "-app-port", "3000",
     "-placement-host-address", "placement:50006",
     "-dapr-grpc-port", "50002",
     "-components-path", "/components"]
    volumes:
        - "./components/:/components"
    depends_on:
      - nodeapp
    network_mode: "service:nodeapp"
  ############################
  # Python app + Dapr sidecar
  ############################
  pythonapp:
    build: ./python
    depends_on:
      - redis
      - placement
    networks:
      - hello-dapr
  pythonapp-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
    "-app-id", "pythonapp",
    "-placement-host-address", "placement:50006",
    "-components-path", "/components"]
    volumes:
      - "./components/:/components"
    depends_on:
      - pythonapp
    network_mode: "service:pythonapp"
  ############################
  # Dapr placement service
  ############################
  placement:
    image: "daprio/dapr"
    command: ["./placement", "-port", "50006"]
    ports:
      - "50006:50006"
    networks:
      - hello-dapr
  ############################
  # Redis state store
  ############################
  redis:
    image: "redis:alpine"
    ports:
      - "6380:6379"
    networks:
      - hello-dapr
networks:
    hello-dapr: