If practical, a wall inside the city protecting vital areas (like the government buildings and blacksmith’s quarter) while being prepared to sacrifice the fisherman’s quarter and docks to enemy attack.
An alternative might be towers (like bulwark monitors) 300 meters out from the coast and spaced 300 meters apart armed with trebuchet reaching out from 300-600 meters (depending on the missile size) … forcing enemy ships to run a 600-900 meter gauntlet (of Greek Fire?) before reaching the docks.
In cities with a natural escarpment along the river, the docks and warehouses might be separated from the first ‘city street’ by a 10-20 foot slope offering the town guard a defensive ‘high ground’ to fight from.
[as far as how these would look on the plan … an inner wall through the city, towers off the coast or stairs on the roads perpendicular to the shore.]
(A strong navy is probably easier).