The government has allocated £3.14 million to help 19 local authorities with a major port prepare for Brexit.