Listen to new container deployment

Hi.

I need to run some scripts on the rancher host (so not inside containers) when a new container is deployed (conf, permission, and so on).

How can I be alert every time a container is deployed both for a new stack/service deploy and for a service scaled up?

Giovanni