dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

Call a script on exit #1780

Open Astrak opened 2 months ago

Astrak commented 2 months ago

I'm using side services through docker that I run before launching serverless offline, however for my colleagues I inline it with docker-compose up -d && serverless offline. Issue is, I would like to docker-compose down when serverless offline is stopped. It looks like the --exec option is not handled anymore. I've also tried using trap 'command' EXIT & serverless offline but command is then executed at the beginning as serverless offline already works around it. Any idea how to do it?