Although not widely known, it is actually forbidden to drink wine, beer, whiskey, and other alcoholic beverages in a non-Jewish establishment or environment. This is true even if the drinks are completely kosher and, regarding wine, even if the wine is mevushal. The ban on drinking with non-Jews is a decree that was enacted by the sages in order to prevent overly social relations and, by extension, intermarriage. As such, although it may be permitted to enter a bar to purchase a beer one should preferably consume the drink off the premises.
The ban on drinking in a non-Jewish establishment only applies if it is done regularly and in a formal setting. As such, it is permitted to occasionally have a quick drink in a non-Jewish establishment. This is true even in the home of a non-Jew. Similarly, one may have a drink in a bar or other non-Jewish venue as long as one does not linger in the bar and if it is done only on occasion. Furthermore, it is completely permitted to drink in a hotel bar or restaurant that one is staying in when travelling. It is also permitted to drink with non-Jews or in a non-Jewish establishment when the majority of those present are Jewish.
Although some authorities, including the Rema, rule that the ban on drinking in a non-Jewish environment does not truly need to be observed, most other authorities disagree. Therefore, one should endeavor to comply with these rules whenever possible. Some say the ban on drinking in non-Jewish environments only applies to more common drinks but that expensive and uncommon drinks were not included in the ban.
According to many authorities, the ban on drinking in non-Jewish establishments extends to drinking coffee in a coffee shop, as well. As the Birkei Yosef says, “It is forbidden [to drink coffee in the coffee shops] due to a concern for intermarriage…One who separates himself from this [ruling] is as if he separates himself from death to life.” Gathering together to drink coffee with non-Jews is also cited as an act of “moshav leitzim” – a gathering of scoffers. There was once a decree in some communities that “no person should make a habit of going to non-Jewish establishments. And one who makes a practice of drinking there is an empty, low person. He cannot be given the title of rabbi and may not hold any position in the community.”
Other authorities rule that it is permitted to drink coffee with non-Jews or in a non-Jewish establishment. They say that the ban on drinking in non-Jewish establishments only applies to alcoholic beverages. It is argued that the concern for over-socialization and intermarriage is only relevant when getting intoxicated with non-Jews.  According to this approach, there is no problem with drinking coffee in a coffee shop, even with non-Jews. It would also seem that the common practice of meeting friends for coffee in a coffee shop is further justified when the majority of such friends are Jewish. This renders one’s gathering, occupying one or more tables, to be a “Jewish environment” even though the rest of the coffee shop is otherwise a “non-Jewish environment.” It is noted that in Baghdad, and presumably in other Arab lands, it was customary for Jews and non-Jews to drink coffee together.
According to all authorities, however, it is best to avoid drinking coffee with non-Jews and to keep it to a minimum whenever possible. Indeed, even though it is permitted to drink coffee prepared by a non-Jew, it does not permit one to use coffee as a medium for unnecessary socializing with non-Jews. There are documented cases of social drinking and socializing with non-Jews that led to intermarriage and other impropriety. Nevertheless, one should always be civil and cordial with one’s non-Jewish neighbors, and periodic socializing is sometimes in order. One should be sure not to come across as arrogant or exclusionary over this issue.
 Shach, YD 114:3.
 YD 114:4. For a comprehensive discussion on the history of this enactment see Aruch Hashulchan, YD 114:1-10.
 Avoda Zara 31b; Rambam, Hilchot Maachalot Assurot 17:9-10; YD 114:4.
 YD 114:1.
 YD 114.
 YD 114:1.; Pri Chadash 114:4.
 YD 114:1; Levush 114:1; Chochmat Adam 66:14.
 Rambam, Hilchot Ma’achalot Assurot 17:10. See Bach, YD 112.
 Biur Hagra, YD 114:8; Pri Chadash, YD 114:6; Chochmat Adam 66:14.
 YD 114:3; Aruch Hashulchan 114:11; Darkei Teshuva 114:7.
 Birkei Yosef, OC 325:2.
 Darkei Teshuva, YD 114:2.
 Pri Chadash, YD 114; Chayei Halevi, YD 4:53.
 Y.D. 113:3, Chochmas Adom 66:14, Rivevos Ephraim 6:79. See Chai Ha’Levi 4:53:6-7.
 Ben Ish Chai, Chukat 2:16; Kaf Hachaim, YD 114:12.
 Aruch Hashulchan, YD 114:6.
 Kaf Hachaim, YD 114:12.
 Radbaz 3:637; Maharikash, YD 114; She’ilat Yaavetz 2:142.
 Radbaz 3:637; Maharikash, YD 114; Chochmat Adam 66:14; Ben Ish Chai, Chukat 2:16.
 Darkei Teshuva, YD 114:2; Chochmat Adam 66:14.
 Pitchei Teshuva, YD 114:1; Kaf Hachaim, YD 114:12.
 Kaf Hachaim, YD 114:14.