The earliest known appearance of the tune today associated with this text is as a fiddle tune called "The Peacock", included in James Aird's A Selection of Scots, English, Irish and Foreign Airs, vol. 2 (1782).
Patrick Weston Joyce, in his Old Irish Folk Music and Songs (1909), gives the tune with a different text under the name "Sweet Cootehill Town," noting, "The air seems to have been used indeed as a general farewell tune, so that—from the words of another song of the same class—it is often called 'Good night and joy be with you all.'" The celebrated Irish folk song collector Colm O Lochlainn has taken note of this identity of melodies between "The Parting Glass" and "Sweet Cootehill Town". "Sweet Cootehill Town" is another traditional farewell song, this time involving a man leaving Ireland to go to America. (taken from Wikipedia).
This song has been sung by Celtic musicians all over the world. I like Ed Sheeran's acapella version.