It is impossible
Almost everyone out there that trains hard has tried to out-train a bad diet at some point, myself included.
I hate to break it to you, but it's impossible to out-train poor eating habits. Especially over the long-term.
Guidelines need to be set in order to get the rewards you deserve from training hard.
Schedule a time to train
Saying or thinking "I'll train later" has the lowest rate of success.
I love training, and yes, it's a part of my job. But with several businesses, three kids and a wife, "getting to it later" simply doesn't work.
Don't buy foods that will tempt you
Why make things harder for yourself? Why would you willingly buy things that you know that you shouldn't be eating? Just having them around the house will be torture. Relying on will power will not work.
Don't drink during the week
Drinking alcohol during the week will crush momentum, motivation, and focus. Do you think you'll get up every morning if you're drinking Tuesday and Thursday night?
Only eat what you bring
Eat what you bring to work... that's it. No extras. If you follow this rule to a T and skip the donuts, pizza, candy, happy hours, and vending machine BS, then you're much more likely to succeed.