Auto-managed docker-compose volume not shared among containers
Define the volume in the following way 

volumes:
  - ${local_path}:/data


or using docker volumes 

version: '3.7'

volumes:
  db-data:

services:
  one:
    image: alpine
    command: sh -c 'echo one &gt;&gt; /data/db.txt &amp;&amp; cat /data/db.txt | wc -l'
    volumes:
      - db-data:/data