Stop dock moving between monitors while moving mouse to the bottom of screen
You cannot "just" stop it - unfortunately.

You have some options to keep it in the same place, but they have drawbacks:

A) Keep the dock on the left or right side of the desktop. That way it will stay in place.

or

B) In Preferences => Mission Control, uncheck "Displays have seperate spaces". Now the dock will stay in place, but you will loose the spaces functionality.