Not sure if applicable, but something I've stumbled upon recently: https://testcontainers.com/.
See:

Perhaps this can help in the subject of this ticket.