Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Azurite to both Docker network and localhost #30

Open
joergjo opened this issue Oct 17, 2024 · 0 comments
Open

Expose Azurite to both Docker network and localhost #30

joergjo opened this issue Oct 17, 2024 · 0 comments

Comments

@joergjo
Copy link
Owner

joergjo commented Oct 17, 2024

Docker Host Access and Dapr Setup Issues

The Compose setup in this project previously relied on accessing the Docker host's IPv4 address from within the Docker network, allowing both the browser on the host and the Dapr sidecar to access Dapr storage bindings.

However, recent Docker Desktop (for Mac) releases no longer support host access via IPv4 addresses, and this method was likely never intended to work, as only the host networking driver should provide such access from a container.

Solution for Azurite Access

To access Azurite, the Dapr sidecar can use the host.docker.internal hostname or the Docker service name azurite. Unfortunately, these hostnames lead to image URLs that break rendering in the browser, as the host machine cannot resolve them.

Fix: ASP.NET Core Tag Helper

We will resolve this issue by implementing:

  • An ASP.NET Core tag helper to update img tag src attributes that use host.docker.internal in their URLs.
  • A tag helper initializer to apply the necessary settings across all img tags automatically, without modifying individual Razor pages.

A new configuration key ImageSource:Host will control the tag helper. When enabled, the tag helper will modify img tags using the host.docker.internal hostname in its src attribute .

Running Outside Docker

This feature is designed primarily for running the full stack in Docker, but it can also be used when running the application outside of Docker while sharing the same database. In such cases, URLs generated in Docker will need updating for proper image rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant