We analyze the Douglas-Rachford splitting method for weakly convex optimization problems, by the token of the Douglas-Rachford envelope, a merit function akin to the Moreau envelope. First, we use epi-convergence techniques to show that this artifact approximates the original objective function via epigraphs. Secondly, we present how global convergence and local linear convergence rates for Douglas-Rachford can be obtained using such envelope, under mild regularity assumptions. The keystone of the convergence analysis is the fact that the Douglas-Rachford envelope evaluated at the generated iterates satisfies a sufficient descent inequality, a feature that allows us to use arguments usually employed for descent methods. We report the results of numerical experiments that use weakly convex penalty functions, which are comparable with the known behavior of the method in the convex case.