The growing popularity of bike-sharing systems around the world has motivated recent attention to models and algorithms for the effective operation of these systems. Most of this literature focuses on their daily operation for managing asymmetric demand. In this work, we consider the more strategic question of how to allocate dock-capacity in such systems. Our main result is a practically fast polynomial-time allocation algorithm to compute optimal solutions for this problem, that can also handle a number of practically motivated constraints, such as a limit on the number of docks moved from a given allocation. Our work further develops connections between bike-sharing models and the literature on discrete convex analysis and optimization.