Greetings!
Do you mean ur docker application should have a different ip than the machine you are running your docker application on, e.g.
Machine docker is running on: 192.168.178.111
Compose app on Docker Machine: 192.168.178.112
Not sure if that is possible.
I have set the ip of my pc that docker is running on to static and then i could reach every application(database and app) on the in compose defined ports:
Machine docker is running on: 192.168.178.111
mssql: 192.168.178.111:1433
app: 192.168.178.111:80
Hope i could help you. Maybe i didnt understand the question tho