It's easy to do with a layer style. What you do is create a stroke. Select Fill Type: Gradient. Then select Style: Shape Burst. Then edit the gradient to have the colors that you want. (This is the hardest part if you don't know what you're doing.) You'll have to slide the paint buckets underneath the gradient once you've opened the gradient editor so that they are touching each other to make the stroke solid. Then just increase the size of the stroke until it looks like you want it to.
I've made you a free style to get you started. It's a triple stroke that goes from black to white to black. Just put it in your Presets>Styles folder under Photoshop and then load in onto your styles pallette.
Just right click > save as
Double Stroke Layer Style