Wanting the mail catcher and phpMyAdmin locally but not in CI, without maintaining two full compose files, is the problem profiles eventually solve — and they are not here yet.
# docker-compose.yml services everyone needs
# docker-compose.override.yml merged AUTOMATICALLY, local extras
# docker-compose.ci.yml explicit, replaces the override
$ docker-compose up -d # base + override
$ docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d
The automatic merge of the override file is the part people do not know about, and it is what lets the local file add bind mounts and exposed ports without the base file mentioning them. Merge semantics differ per key — lists concatenate, scalars replace, and command replaces entirely — which is exactly why guessing is unreliable. Profiles arrive in Compose 1.28 in January 2021 and make all of this a flag.