Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

05. Deploying eShopOnContainers to a Docker Host Production environment

Cesar De la Torre edited this page Nov 1, 2017 · 2 revisions

Related readme files (use them for more information after reading this)

Deploying on a "production" environment

IMPORTANT: This instructions section is in early draft state because the current version of eShopOncontainers has been tested most of all on plain Docker engine and just smoke tests on some orchestrators like ACS Kubernetes and Docker Swarm.

However, since there are a few folks testing it in "production" environments out of the dev PC machine (VS2017+Docker) but in a prod. environment like Azure or a regular Docker Host, here's some important infor to take into account, in addition to the CLI Deployment procedure explained here: https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)

The "by default configuration" in the docker-compose.override.yml file is set with specific config so it makes it very straightforward to test the solution in a Windows PC with Visual Studio 2017, almost just F5 after the first configuration. But, for instance, it is using the "10.0.75.1" IP used by default in all "Docker for Windows" installations, so it can be used by the Identity Container for the login page when being redirected from the client apps without you having to change any specific external IP, etc.

However, when depoying eShopOnContainers to other environments like a real Docker Host, or simply if you want to access the apps from remote applications, there are some settings for the Identity Service that need to be changed by using the config especified at a "PRODUCTION" docker-compose file: docker-compose.prod.yml (for "production environments"). That file is using the environment variables provided by the ".env" file which basically has the local name and the "External" IP or DNS name to be used by the remote client apps.

FIRST STEP: Basically, you'd need to change the IP (or DNS name) at the .env file with the IP or DNS name you have for your Docker host or orchestrator cluster. If it is a local machine using Docker for Windows, then, it'll be your real WiFi or Ethernet card IP: https://github.com/dotnet/eShopOnContainers/blob/master/**.env**

The IP below should be swapped and use your real IP or DNS name, like 192.168.88.248 or your DNS name, etc. if testing from remote browsers or mobile devices.

ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92

SECOND STEP: For deploying with docker-compose, instead of doing a regular “docker-compose up” do:

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

So it uses the docker-compose.prod.yml file which uses the EXTERNAL IP or DNS name. https://github.com/dotnet/eShopOnContainers/blob/master/docker-compose.prod.yml

And take into account the procedure here: https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)

Clone this wiki locally