running two separate Python-Flask api via a single docker file

I want to run two different python api files running on different ports via a single container.

My docker file looks like:

FROM python:3.7-slim-buster

RUN apt-get update && apt-get install -y libgtk2.0-dev cmake libpoppler-cpp-dev poppler-utils tesseract-ocr


COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt 

COPY . .

RUN chmod a+x

CMD ["./"]

And the .sh file looks like:


exec python3 /app1/ &
exec python3 /app2/ &

While the docker build is a success without any error, the docker run doesn’t throw any error and exits the command line. I’m curios to know where is it failing, any insight is highly appreciated.

Source: Docker Questions