I have been using reflex https://github.com/cespare/reflex for the same thing in some of our docker projects
Example .reflex.conf to run one command when an openapi spec changes and another when any go files change:
-g "spec.yaml" -- bash -c 'make'
-sr "\.go$" -- go run cmd/app/main.go
Then run it with: reflex -d fancy -c .reflex.conf