How to run separate containers for separate config files


I have a below project dir:


I have created a docker image. I want to run three containers for each of the three client. Each of them should use their own defined configs. As of now I am just using the below dockerfile because I just had 1 config file. But is there a way to define which config file to use which starting a container

# syntax=docker/dockerfile:1

FROM python:3.8-slim-buster

COPY requirements.txt requirements.txt

RUN pip3 install -r requirements.txt

COPY . .

CMD ["python3", ""]

Three possible solutions come to mind:

  • Introduce an environment variable with the name of the config file and then leverage it from your python code to load the config based on the environment variable
  • Write an entrypoint script that uses environment variables to either update an existing or generate a config file based on variable
  • Use a volume to bind a configuration from the host into the container.

From my perspective, it should be avoided to add environment specific configurations into an image.