A volume is storage managed by Docker, independent of the container's lifecycle. It keeps data (database, uploaded files) when the container is removed or recreated. A folder mount (bind mount) links a host folder to the container.
Example
volumes:
- pgdata:/var/lib/postgresql/data