Life-cycle production optimization in reservoir engineering poses computational challenges, especially under geological uncertainty and complex models. This study introduces a novel approach to enhance optimization accuracy and efficiency by integrating automatic gradient computation from a deep-learning-based reservoir surrogate into the optimization process. Departing from conventional techniques, we aim to leverage the inherent automatic differentiation (AD) capabilities of deep-learning platforms to compute gradients seamlessly within the optimization framework. Our method builds upon the Embed-to-control Observe (E2CO) deep-learning proxy model, featuring an architecture comprising encoder, transition, transition output, and decoder blocks. The transition output block enables direct prediction of reservoir system outputs from input state variables without using any explicit well-model equations. Coupled with a gradient-based line-search sequential quadratic programming (LSSQP) workflow, our approach, enhanced by the novel integration of automatic gradient computation from the deep-learning proxy, adeptly manages robust production optimization under nonlinear state constraints. Performance evaluations are conducted using a portion of the SPE10 benchmark reservoir model, demonstrating the efficacy of the proposed approach compared to conventional methods. Our findings reveal that the integration of automatic gradient computation from the deep-learning-based reservoir surrogate significantly enhances optimization efficiency. The trained and cross-validated multi-model E2CO surrogate accurately predicts state variables and well outputs under geological uncertainty. Utilizing the AD-based gradients derived from the deep-learning proxy for the gradient-based LSSQP workflow, our approach achieves optimal solutions comparable to the stochastic gradient approach and the direct optimization using high-fidelity reservoir simulators. Moreover, the proposed optimization workflow demonstrates superior time efficiency compared to conventional approaches directly coupled with reservoir simulators.