April 2017
Beginner
404 pages
9h 30m
English
You can also define named volumes apart from declaring them as part of the services as we saw preceding. The named volume can be used across services defined in the compose definition:
version: '3' services: db: image: microsoft/mssql-server-windows-express ports: - "1433:1433" volumes: - data-volume: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 = db - cache_connection = cache networks: default: driver: nat ipam: driver: default config: - subnet: 172.20.81.0/24 volumes: data-volume:
Read now
Unlock full access