docker compose volume script code example
Example 1: docker compose volumes
/host/path:/container/path
Example 2: docker compose vol
# Mount host paths or named volumes, specified as sub-options to a service
db:
image: postgres:latest
volumes:
- "/var/run/postgres/postgres.sock:/var/run/postgres/postgres.sock"
- "dbdata:/var/lib/postgresql/data"
volumes:
dbdata: