Docker-compose Migrate with new docker versions?

Dear all,
what is the best practice for defining mongodb container and launch migration on container start with newest docker versions?

Tnx