I'm not sure whether this is the right way to do this, but I have a similar requirement for a custom image and here is what I do. I am developing a custom script that requires additional Python modules. I am using Ansible to deploy netbox-docker to my host. Rather than rebuilding the base image all the time, what I do is, prior to running 'docker-compose up', I build a new docker image based on netboxcommunity/netbox:latest, tag it as netbox:some_custom_tag then inject a docker-compose.override.yml file which contains (amongst other stuff):
services:
netbox:
image: netbox:some_custom_tag
When you then run docker-compose up, it will launch your custom image for the netbox image rather than the stock one, leaving all the others as they are.
Seems to work!
I'd combine this with a bind mount so you can make changes to your plugin code without having to rebuild and restart your image as suggested above.