I am using docker-compose and v3. I am trying to install the volume in docker:
./appdata:/appdata
I would like to have it as a volume, and then reference this volume from several containers. the volume configuration link only shows data-volume:as a named volume with no value, so it doesn’t look like that.
services:
nginx:
build: ./nginx/
ports:
- 80:80
links:
- php
volumes:
- app-volume
php:
build: ./php/
expose:
- 9000
volumes:
- app-volume
volumes:
app-volume: ./appdata:/appdata
This gives me:
ERROR: In the './docker-compose.yml' file, the volume 'app-volume' should be a mapping, not a string.
Obviously, I know that I need to change the key / value pair volumes, but I'm not sure how to change this so that I can share the volume between services.
volumes_from, . , - volumes_from , , command: true , , .
?
, :
nginx:
volumes:
- ./appdata:/appdata
php:
volumes:
- ./appdata:/appdata
, : -)