Want to change SMTP Server hosted in a Docker Container

I have hosted my Ghost Site in a Docker container. How can I change the SMTP server settings? I’m using Elastic Email.

Edit config.production.json and enter the credentials.

I assume you know how to connect into your ghost docker, and have the following information to hand to populate the settings.

   "mail": {
      "transport": "SMTP",
      "options": {
         "service": "",
         "host": “",
         "port": ,
         "secureConnection": true,
         "auth": {
            "user": "",
            "pass": ""
         }
      }
   }
   ,

I’ve already tried this, nothing happened. I changed the configuration file, saved and ran ghost-cli restart, but I get an error that, I need to be a non root user. When I created a non root user and run this command, it throws another error, like An error occurred. Message: 'EACCES: permission denied, open '/var/lib/ghost/.ghostpid''. When i restart the container, everything is gone. i have persistant storage as well.