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

Add ability for ContainerResource to reach ProjectResource by name in Run mode #327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dombrovsky
Copy link

This modifies Metrics sample.

The goal is to change in prometheus.yml this
- targets: ['host.docker.internal:5048'] # hard-coded port matches launchSettings.json
to this
- targets: ['app'],
so that prometheus container can reach metricsapp that runs on host in development environment by resource name instead of hardcoded endpoint.

In this PR this is achieved by:

  1. Creating custom docker network and adding all ContainerResource to it.
  2. Adding simple Nginx container with network alias equal to ProjectResource name which should be accessible by container.

@davidfowl
Copy link
Member

I don't think we should make the metrics example more complex.

@davidfowl
Copy link
Member

This container proxy resource is a very cool stand alone sample though.

@dombrovsky
Copy link
Author

Thanks for review. I'll prepare it as a standalone sample and update PR.

…ginx container as a proxy between containers and ProjectResources available on host.docker.internal
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

Successfully merging this pull request may close these issues.

2 participants