Assuming you are running 1.3+, the Underground Jungle is invincible.
Chlorophyte makes the Jungle immune to Corruption/Crimson. Your only worry is the Surface Jungle, and spread of Crimson/Corruption there is easily stopped by a couple tunnels on either side of the Jungle that go down to the Underground Layer.
Assuming you built your base in the center of the map, dig a U-shaped "bowl" around your base with quarantine tunnels. Said tunnels need to go down to the Underground at the very least on the vertical shafts and have a horizontal shaft connecting the two vertical ones, and these need to be 5+ blocks wide of incorruptible material or air. Just make sure no grass can grow on either side (the corruption/crimson can spread through thorny vines which can grow on any grassy surface). You can prevent grass from growing by lining the walls of such quarantine tunnels with any incorruptible material such as Wood or Snow.
You can also dig quarantine tunnels around anything else you want to protect, such as Deserts. In the end, though, you just need to last long enough to get a Clentaminator which lets you change entire biomes though it is somewhat pricey to do this (the gun itself is 2 platinum, and the solution is somewhat expensive over time too).
Once you kill Plantera, your Corruption/Crimson woes are mostly over, as the spread is vastly slowed down.
EDIT: I had/have a guide around here somewheres about quarantining a base, but I'm not sure the screenshots would still work because Steam likes to change the format of their links which is annoying.