What you want is definitely possible, but as with a lot of things it might take a bit of time to get it to behave in exactly the way you want.
I use a combination of Docker and a whole bunch of Bash scripts to do what I want — used to use Vagrant, but a VM like that really burned up my laptop battery.
Whenever I start a new WordPress project, I start it off with some NPM commands:
npm run docker:create-image
npm run docker:create-container
npm run docker:collect
npm run docker:start
npm run docker:provision
At this point I can run npm start to fire up browser-sync, that automatically gives me an IP and opens up a port so that other machines can visit too.
I personally combine this with webpack and browser-sync for most of the front-end stuff, but I think that's more dependant on your use case. When needed I can also log into the docker instance.
I'd really recommend messing around with all this yourself for a bit, especially the Docker bit took me a while to understand.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.