as shown in the figure, officially describes how to use docker-compose to start several services of nsq. Shared data volumes are not configured in docker-compose, but how to enable persistence is described in Persisting NSQ Data. How to configure this in docker-compose?
docker-compose.yml nsql :
nsqd volumes
after the service is restarted, the data of the nsq background management system is gone.