Is there any way by which I can set a lifetime for a container after that much of time it should be stopped automatically and only awake when someone send a request. I wanted something like Preemptable Google Compute engine instance or Heroku free Dyno which sleeps after 1 hr of inactivity and awake again when a request is send to that instance.
Note: I have docker compose project so I want to set the life time for one service which depends on other services also. I have a traefik container runs separately beside the docker-compose project which handles the request and sends to containers. So is there something like request_post_hook which can start that stopped docker-compose container when receive any request ?