Updatinga configuration file when running the docker run

Hello,
I’m quite new to docker and I’m trying to migrate an existing application we have that currently runs on Virtual Machine to Docker with Windows Container.
The application is a windows service that reads from a .ini config file on startup and then it connects to a DB and exposes some data, based on the query.

Now since Docker Container should be immutable, I need to pass the db connection, the web hosting port and so on via docker run command

suppose I need to execute my docker container as

docker run -e WEB_PORT:4000

I should edit my config file so it has something as

[Main]
HttpPort=$WEB_PORT
ThreadNumbers=5

Is this possible? how? or should I set that information during the compose? The idea should be to simplify as much as possible the deploy of the docker application. Another approach would be to store that information inside a volume mount point and serve them from there? (My container would only hold a file that’s the exe at this point).

Thanks in advance