The Quantum Chromodynamics (QCD) phase diagram involves the behaviors of strongly interacting matter under extreme conditions and remains an important open problem. Based on the non-perturbative approach from the gauge/gravity duality, we construct a family of black holes that provide a dual description of the QCD phase diagram at finite chemical potential and temperature. The thermodynamic properties from the model are in good agreement with the state-of-the-art lattice simulations. We then predict the location of the critical endpoint and the first-order phase transition line. Moreover, we present the energy spectrum of the stochastic gravitational-wave background associated with the QCD first-order transition, which is found to be detected by IPTA and SKA, while by NANOGrav with less possibility.