Not sure I understand the problem precisely, a couple of thoughts from what I understand:
1) Aren't (Docker/OCI) containers supposed to be immutable (at least, as a best practice) ?
2) Have you looked at Pyinfra and would it help solve your problem ?