Duplication between compose configs

I’ve got two projects. Each with their own docker-compose.yml. They work fine on their own, however when running both on the same host (occasionally needed when debugging), they have problems due to port duplication. I’m fine with giving a different http port to each, but don’t want to maintain separate db/php-fpm ports if I add a third project for example.

Curious how others go about this. Networking?