Yeah, it's the classic Howard Hawks film RIO BRAVO.

So good, in fact, that it was remade twice.
El Dorado (1966) and
Rio Lobo (1970)
but as usual, the original is the best.