In Fallout 4, with the Vault 88 DLC, you can play as a pure Vault Dweller. I ran an experiment like this, and the Vault turned out to be completely autonomous and self-sufficient, even on Survival mode.
My character's journey: I left Vault 111, grabbed Dogmeat, and headed toward Vault 88. Traveling across the wasteland as a level 1 hobo is dangerous, especially on Survival, but there's a relatively easy route you can take. Eventually, I made it to the ghoul raider quarry and sneaked/ran straight into the Vault. Once inside, I had to break the siege at the gates—I blew up three raiders near the console with grenades, and Dogmeat and I barely managed to take down the last one by the door.
Things got easier inside the Vault. To clear out the ghouls, radscorpions, and deathclaws, I just used turrets—literally carried them around with me. In the end, I cleared the entire cave system, scrapped all the junk, and built a massive Vault right up to the build limit. It houses 30 settlers, mostly in two-person rooms, plus two large dormitories (one for men and one for women). There are 4 floors in total, with the player's quarters on the top floor.
Once the construction was done, I started doing the DLC's questline, which was pretty fun. I did have to leave the Vault once to go to HalluciGen and clear it out. While I was out, I took the opportunity to swing by Sanctuary and pick up Codsworth. And that was it.
Ultimately, my character reached level 22 just from building and doing the Vault quests. The Vault produces a ton of food that automatically gets stored in the workbench, and I also set up 400 units of water production, which partially goes into the workbench as well and sells for a great price. I have 5 or more vendors down there, so farming caps is effortless—for example, a single batch of water gets me around 3,000 caps. I use those caps to buy resources like steel from my local vendors, craft poisoned caltrops, and sell them back for an even bigger profit, earning XP in the process.
Long story short, you never have to leave the Vault again. There's no point, and raiders can't even break through the main Vault door.