I hope you won't just take this as cynical, because it isn't meant to be. But, I've been there brother. There are a lot of silver linings here if you are willing to look at them. Yes, some of this is going to sound wrong, but give it some thought.
1. Mannnnny marriages are ended during naval service. Yours seems to be ending at a difficult time, but it is actually better to have it happen now than for you to come home from a deployment to find that all you have worked for is gone. You're still young, probably don't have a lot of property to split, perhaps no children. You have much less to lose at this point - except the relationship itself - and lots of time to get your life back on track than a guy whose marriage breaks up later in life.
2. You have just been relieved of a huge obligation, leaving you with just the one huge obligation. You have a career, which is enough of a burden for one young guy who hasn't made it yet.
3. Getting fit and strong will not only help blow away the depression, it will increase your self-esteem and confidence. Not to mention that it will be pretty good revenge against her for leaving you. That's the cynical part, but really, letting yourself deteriorate into a depressed, overweight guy who got booted out of the navy will only justify her leaving you in her mind AND in yours. Buddy, you OWE it to YOURSELF to feel from this point on that she didn't dump a loser; she walked away from a winner with a great future. Which guy do you want to be?
Now, get to the gym. Get fit. Get strong. Get QUALIFIED. Get your life back, sailor! Yes, it was her decision. But as far as you are concerned from this moment on, it was a BAD decision. Now, go make it happen.
Best of luck to you, and thank you for your service.