Sorry for the delay replying!
There are two things you need to consider from the Mosquitto side when running on Docker. First off, you need to configure one or more ports that Mosquitto will listen on. You do this in your configuration file. Here are some examples, there are more details on the configuration file at mosquitto.conf man page | Eclipse Mosquitto and
# Listener with no encryption and no authentication/access control
# Listener with no encryption, with password and acl file access
# See https://mosquitto.org/man/mosquitto_passwd-1.html for info on password files
# Listener with no encryption, with dynamic security plugin
# Listener with encryption, with dynamic security plugin
# See https://mosquitto.org/documentation/dynamic-security/
Once you have your configuration file, it needs to be provided to your container. I would suggest using a local directory structure like this for your container data:
The second step is that you need to provide access to the port used in the container. If you’re running docker directly it would look like this, assuming you’re using one of the port 1883 options and following the above local directory structure:
docker run -it -v mosquitto/config:/mosquitto/config -v mosquitto/data:/mosquitto/data -p 1883:1883 eclipse-mosquitto:2
That gives you a running Mosquitto instance listening on port 1883/8883 of the NAS external interface. The next step is to find the external IP address of your NAS and connect to it - doing that is down to you.
I hope that helps.