I'm trying to write a compose-file using a service (node) that I'd like to scale to 3 containers. This service has a volume to be bond to my local system for persistence, but I'd like the different tasks having different binding on my system ? I tried to use the template {{.Task.Slot}} inside my docker-compose.yml as shown below, but I cannot figured out out to make it work...
version: '3.2'
services:
node:
build:
context: ./node
volumes:
- nodeVol:/data
command: ["myapp"]
volumes:
nodeVol:
external:
name: './persistence/{{.Task.Slot}}'
Any idea of what went wrong ?