shared volume docker compose code example
Example 1: share volume between containers docker-compose
services:
nginx:
build: ./nginx/
ports:
- 80:80
links:
- php
volumes:
- app-volume:location_in_the_container
php:
build: ./php/
expose:
- 9000
volumes:
- app-volume:location_in_the_container
volumes:
app-volume:
Example 2: docker mount volume
docker run -v /host/directory:/container/directory -other -options image_name command_to_run