You cannot reference a part of a docker-compose file from another, but you can have an .env file alongside them where you can declare variables in the format NAME=VALUE, and reference that in the dc files with ${NAME}, assuming your dc files reside alongside each other (with different names) and the .env file itself. I have done this before.
I cannot say if that will work for your use case, as I haven't tried to use the same docker volume in different containers. I don't even know if that is possible, given the possibility of conflicts if both containers tried to access the same files, something to test out, for sure.
I'm using Keycloak and Traefik as reverse proxy, and some apps don't have integration with SSO, so I turn off authentication and use traefik-auth in front of them, which works ok for my use case.
For the rest, it depends, and gotta take a look at their documentation.