April 2017
Beginner
404 pages
9h 30m
English
While setting up environments using multiple containers it might require to setup dependencies among the containers. For example, if a web container requires database connection string or cache connection string the database and cache containers should be built prior to the web container. docker-compose has the depends_on property can be used to setup dependencies among the containers as shown in the following code:
version: '3' services: db: image: microsoft/mssql-server-windows-express ports: - "1433:1433" volumes: - c:\data cache: image: learningwsc/redis-server ports: - "6379:6379" web: build: . image: webserver:latest container_name: webcontainer ports: - "80:80" depends_on: - db - cache environment: - db_connection = ...Read now
Unlock full access