dotnet / dotnet/dotnet-docker

Example of using multiple Docker containers with HTTPS and HOSTNAME

Open
#4,861 5 comments 0 reactions 0 assignees View on GitHub
area-samples
Dominant language
Dockerfile
Stars
4.9k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
26

Description

### use multiple Docker containers with HTTPS and HOSTNAME for development

instead of using localhost instances for developing and debugging applications, would like to use Docker containers which are closer to what a production environment would look like. examples [samples/run-aspnetcore-https-development.md ](https://github.com/dotnet/dotnet-docker/blob/main/samples/host-aspnetcore-https.md) show how to configure a single Docker container. The problem is with a multi-container solution (eg application using a micro-service architecture) I have yet to find an example that actually works.

### Describe the Solution

Example showing
- 3 containers: service1, service 2, service3.
- each container has a defined hostname: service1.local, service2.local, service3.local
- each container is configured to use HTTPS
- each container has an aspnetcore app configured to use HTTPS
- service 1: publish an api to get a random number (or something equally trivial)
- service 2: publish an api to get weatherforecast; app calls https://service1.local/random to use in weatherforecast
- service 3: web ui to call https://service2.local/weatherforecast and display the results

Basically a chained series of api calls over https.
(generic example of this is authentication with bearer tokens issued from identity server).

### Additional Context

The developer community has a common goal of improving the security of applications.
We need good examples that demonstrate best practices for common scenarios.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.