Sie sind hier: Startseite | Wissen

Was ist Docker Compose?

Mit Docker Compose stellt man mehrere Container zu einer Anwendung zusammen. Dazu verwendet man Compose File (docker-compose.yml).

Beispiel (Quelle: https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose)

version: '2'

services:
  webmvc:
   image: eshop/webmvc
   environment:
   - CatalogUrl=http://catalog.api
   - OrderingUrl=http://ordering.api
   - BasketUrl=http://basket.api
   ports:
   - "5100:80"
   depends_on:
   - catalog.api
   - ordering.api
   - basket.api

  catalog.api:
   image: eshop/catalog.api
   environment:
   - ConnectionString=Server=sql.data;Initial Catalog=CatalogData;User Id=sa;Password=your@password
   expose:
   - "80"
   ports:
   - "5101:80"
   #extra hosts can be used for standalone SQL Server or services at the dev PC
   extra_hosts:
   - "CESARDLSURFBOOK:10.0.75.1"
   depends_on:
   - sql.data

  ordering.api:
   image: eshop/ordering.api
   environment:
   - ConnectionString=Server=sql.data;Database=Services.OrderingDb;User Id=sa;Password=your@password
   ports:
   - "5102:80"
   #extra hosts can be used for standalone SQL Server or services at the dev PC
   extra_hosts:
   - "CESARDLSURFBOOK:10.0.75.1"
   depends_on:
   - sql.data

  basket.api:
   image: eshop/basket.api
   environment:
   - ConnectionString=sql.data
   ports:
   - "5103:80"
   depends_on:
   - sql.data

  sql.data:
   environment:
   - SA_PASSWORD=your@password
   - ACCEPT_EULA=Y
   ports:
   - "5434:1433"

  basket.data:
   image: redis

Querverweise zu anderen Begriffen im Lexikon

RDL
SQL
Container
Docker

Beratung & Support:

Schulungen zu diesem Thema:

 Anfrage für eine individuelle Schulung zum Thema Docker Compose  Gesamter Schulungsthemenkatalog