We study the joint optimisation of capacity and safety stock allocation in assembly systems. Particularly, we consider capacitated systems with base-stock policies and periodic review. Capacity allocation is restricted by budget constraints, which can connect multiple systems. Our objective is to minimise overall inventory holding costs while satisfying service level as well as budget constraints. We propose an algorithm to jointly approximate optimal capacity allocation and base-stock levels. To this end, we introduce a set of convex approximations for this non-convex optimisation problem. In order to solve the resulting convex programmes, we analytically compute sample path derivatives via infinitesimal perturbation analysis. By iteratively adapting the approximations, we achieve good capacity allocations and base-stock levels for the original problem. Furthermore, we introduce a heuristic to allocate capacity, which originates from link capacity allocation in communication networks and use it as a benchmark. The algorithm is applied to small illustrative examples as well as cases motivated by the semiconductor manufacturing process at IBM Systems. It turns out that particularly for high utilisation levels, our algorithm can achieve significant improvements compared to the capacity allocation heuristic.