The paper presents the two-phase MINLP topology and standard sizes optimization of a single-storey industrial steel building. The structure consists of main portal frames, connected with purlins. It is made from standard hot rolled I sections. The Mixed-Integer Non-Linear Programming (MINLP) optimization of the structure is applied. The MINLP performs a discrete topology and standard dimension optimization, while continuous parameters (stresses, deflections, mass, costs, etc.) are calculated simultaneously inside the continuous space. Since the discrete/continuous optimization problem of this type of structures is non-convex and highly non-linear, the Modified Outer-Approximation/EqualityRelaxation (OA/ER) algorithm is used for the optimization. The defined mass objective function is subjected to the set of equality and inequality constraints known from the structural analysis and dimensioning. The dimensioning of steel members is performed in accordance with Eurocode 3.The MINLP optimization is performed in two phases. In the first phase, the topology optimization of the structure at the relaxed dimensions is performed only. This phase gives a good linear global approximation to the structure for the next phase. When the optimal topology is reached, the optimization is continued at the second phase for the overall topology and standard section discrete optimization. Alongside the optimal structure mass, the optimal topology with the optimal number of portal frames and purlins as well as all standard crosssections are obtained. The paper includes the theoretical basis and a practical example with the results of the optimization.