compose.yml
file, which looks like this:
version: \'2\'
services:
discovery-microservice:
build: discovery-microservice
context: /discov
I wanted a volume mapped to a specific path on the external (host) server. I tried putting that under the top-level volumes
entry in docker-compose.yml
. After looking at the docker-compose file docs, I realized that that type of volume does not go there. Instead, it goes only under the volumes
entry within the container definition. E.g.:
version: "3.7"
services:
web:
image: my_custom_web_image
build: ./app
volumes:
- ./app/subdir:/usr/src/app/subdir