There are a couple of ways to go about this. The simplest way, if you're using Docker Compose, is to just have a folder (say modules) with the third-party modules you'd like to add. Then, simply bind-mount the individual modules into place under /usr/local/bin/user-lib/modules. It might look something like this:
Then, when you launch the services, they'll load that module alongside the others that are in that folder (from the base image). Combine this with the GATEWAY_MODULES_ENABLED environment variable to whitelist the other built-in modules as desired.