Edition 0 Updated to asp. Net core 0


Targeting multiple environments



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə109/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   105   106   107   108   109   110   111   112   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Targeting multiple environments 
A typical use case is when you define multiple compose files so you can target multiple environments
like production, staging, CI, or development. To support these differences, you can split your 
Compose configuration into multiple files, as shown in Figure 6-12. 


122 
CHAPTER 5 | Designing and Developing Multi-Container and Microservice-Based .NET Applications 
Figure 6-12. Multiple docker-compose files overriding values in the base docker-compose.yml file 
You can combine multiple docker-compose*.yml files to handle different environments. You start with 
the base docker-compose.yml file. This base file contains the base or static configuration settings that 
do not change depending on the environment. For example, the eShopOnContainers app has the 
following docker-compose.yml file (simplified with fewer services) as the base file. 
#docker-compose.yml (Base)
version:
'3.4'
services:
basket-api:
image:
eshop/basket-api:${TAG:-latest}
build:
context:
.
dockerfile:
src/Services/Basket/Basket.API/Dockerfile
depends_on:
-
basketdata 
-
identity-api 
-
rabbitmq 
catalog-api:
image:
eshop/catalog-api:${TAG:-latest}
build:
context:
.
dockerfile:
src/Services/Catalog/Catalog.API/Dockerfile
depends_on:
-
sqldata 
-
rabbitmq 
marketing-api:
image:
eshop/marketing-api:${TAG:-latest}
build:
context:
.
dockerfile:
src/Services/Marketing/Marketing.API/Dockerfile
depends_on:
-
sqldata 
-
nosqldata 
-
identity-api 
-
rabbitmq 
webmvc:


123 
CHAPTER 5 | Designing and Developing Multi-Container and Microservice-Based .NET Applications 
image:
eshop/webmvc:${TAG:-latest}
build:
context:
.
dockerfile:
src/Web/WebMVC/Dockerfile
depends_on:

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   105   106   107   108   109   110   111   112   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin