How to edit nginx files and make it permanently applied?

How can I edit Nginx files and make it permanently applied?
What happens is whenever I make changes, and restart Nginx the docker gets recreated with old configurations. So my custom changes get override by docker default configurations
I also don’t reboot VPS or restart Nginx, else it will break the site.