As long as you’re doing/taking something to ensure a good night’s sleep, you should handle the 3rd shift much better than I did. Whatever else comes up, just get that sleep, or else your health, state of mind, and everything you work for in the gym will fall to pieces.
When I worked the graveyard shift (in an actual funeral home, by the way), I preferred to go to sleep soon after I got home in the morning. That way, I gave myself some time to work with in case I overslept so I wouldn’t be late. Then I’d have the whole evening to find time to work out, as I was making sure I wouldn’t fall back asleep. I found if I waited until morning, I was risking accidentally falling asleep before I could work out.
Now, if you have a good enough gym at your job, that sounds like the best option.
Good luck with the graveyard, man.