We prove the convergence of a modified Jordan–Kinderlehrer–Otto scheme to a solution to the Fokker–Planck equation in \(\Omega \Subset \mathbb {R}^d\) with general—strictly positive and temporally constant—Dirichlet boundary conditions. We work under mild assumptions on the domain, the drift, and the initial datum. In the special case where \(\Omega \) is an interval in \(\mathbb {R}^1\) , we prove that such a solution is a gradient flow—curve of maximal slope—within a suitable space of measures, endowed with a modified Wasserstein distance. Our discrete scheme and modified distance draw inspiration from contributions by A. Figalli and N. Gigli [J. Math. Pures Appl. 94, (2010), pp. 107–130], and J. Morales [J. Math. Pures Appl. 112, (2018), pp. 41–88] on an optimal-transport approach to evolution equations with Dirichlet boundary conditions. Similarly to these works, we allow the mass to flow from/to the boundary \(\partial \Omega \) throughout the evolution. However, our leading idea is to also keep track of the mass at the boundary by working with measures defined on the whole closure \({{\overline{\Omega }}}\) . The driving functional is a modification of the classical relative entropy that also makes use of the information at the boundary. As an intermediate result, when \(\Omega \) is an interval in \(\mathbb {R}^1\) , we find a formula for the descending slope of this geodesically nonconvex functional.