I have no idea how to run .NET applications in a Docker container. But the standard way of "parameterizing" a Docker container is setting up
environment variables. For example, when you start a MySQL container, you set the desired database name and the database credentials via the corresponding environment variables.
See this example:
https://dbschema.com/2020/03/31/how-to-run-mysql-in-docker/
Note especially how they set environment variable
MYSQL_ROOT_PASSWORD to configure the root password for the MySQL instance that will be running in the container. There are many more environment variables that can be set for the MySQL container. Please see here (section "Environment Variables") for details:
https://hub.docker.com/_/mysql?tab=description
The MySQL container only servers as an example here! The environment variables will of course be different for each "type" of container. Your .NET container could offer other environment variables.
Another option would be to pass a
custom configuration file into the container. Again, the details are different for each "type" of container, but you'll find an example for the MySQL container.
The docker container contains both the front end in say angular or react and a .NET core web api with services. |
It's probably better to have a
separate container for each service and have your containers communicate via network ports. Have a look at
docker compose for managing
multi-container setups.