79533206

Date: 2025-03-25 09:33:32
Score: 0.5
Natty:
Report link

I've got the solution for swagger not running on correct port and for dapr sidecar hit issue as well :

apprently I needed to expose dapr sidecar port on my service application and had to use network_mode for dapr service in yaml file of docker-compose,

and needed to expose that port in docker-compose.override.yaml file.

here is the change to do so :

docker-compose.yaml : (check ports and network_mode)

services:
  webapplication4:
    image: ${DOCKER_REGISTRY-}webapplication4
    build:
      context: .
      dockerfile: WebApplication4/Dockerfile
    ports:
      - "5000:5001"
      - "6000:6001"
    volumes:
      - ./aspnet/https:/https:ro
    networks:
      - webapp-network

  webapplication4-api-dapr:
    image: "daprio/daprd:latest"
    command: ["./daprd", 
        "--app-id", "web4", 
        "--app-port", "5001", 
        "--app-protocol", "https",
        "--dapr-http-port", "6001"
    ]
    depends_on:
      - webapplication4
    volumes:
      - ./aspnet/https:/https:ro
    network_mode: "service:webapplication4"

networks:
  webapp-network:
    driver: bridge

docker-compose.override.yaml :

services:
  webapplication4:
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_HTTPS_PORTS=5001
    volumes:
      - ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
      - ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Fenil Patel