City officials have inked a pact that could dramatically cut back dock workers and cargo facilities on the Brooklyn waterfront in favor of beer gardens and possibly apartments.

It will transfer control of Red Hook’s cargo port to the city, which plans a dramatic redesign intended to draw “hundreds of millions” of dollars in public and private investment, Deputy Mayor Dan Doctoroff said yesterday.

The site, currently controlled by the Port Authority, is used as a cargo port by American Stevedoring and a cruise-ship terminal.