How to launch a container from another container

Hello all,

I am looking for some community support on the following issue.

I have a Python/Flask up that allows uploading files. Once uploaded, I want to run another process to handle the file. The handling may take up to an hour, so it needs to be in the background/async process from the file upload. Part of the handling is done by running a docker container.

This works just fine when the Python app runs on the host machine. I can invoke “docker run …” to spawn the background processing. However, I would like to dockerize the Python app as well. When I do it, I get the error of Docker not being available within the docker container.

What is the best to handle such a scenario:
a. Install docker within a docker container to allow spawning sub-containers? (Sounds overly complicated)
b. Give the container access to the docker on the host machine (I read that this is a bad practice)
c. Have something running on the host machine that spawns the processing container as needed?

Any tips will be appreciated!