We develop a model of Bose-Einstein condensate dark matter halos with a solitonic core and an isothermal atmosphere based on a generalized Gross-Pitaevskii-Poisson equation [P.H. Chavanis, Eur. Phys. J. Plus 132, 248 (2017)]. This equation provides a heuristic coarse-grained parametrization of the ordinary Gross-Pitaevskii-Poisson equation accounting for violent relaxation and gravitational cooling. It involves a cubic nonlinearity taking into account the self-interaction of the bosons, a logarithmic nonlinearity associated with an effective temperature, and a source of dissipation. It leads to superfluid dark matter halos with a core-halo structure. The quantum potential or the self-interaction of the bosons generates a solitonic core that solves the cusp problem of the cold dark matter model. The logarithmic nonlinearity generates an isothermal atmosphere accounting for the flat rotation curves of the galaxies. The dissipation ensures that the system relaxes towards an equilibrium configuration. In the Thomas-Fermi approximation, the dark matter halo is equivalent to a barotropic gas with an equation of state P = 2πas 2 ρ 2 /m 3 + ρkBT /m, where as is the scattering length of the bosons and m is their individual mass. We numerically solve the equation of hydrostatic equilibrium and determine the corresponding density profiles and rotation curves. We impose that the surface density of the halos has the universal value Σ0 = ρ0r h = 141 M /pc 2 obtained from the observations. For a boson with ratio as/m 3 = 3.28 × 10 3 fm/(eV/c 2 ) 3 , we find a minimum halo mass (M h )min = 1.86 × 10 8 M and a minimum halo radius (r h )min = 788 pc. This ultracompact halo corresponds to a pure soliton which is the ground state of the Gross-Pitaevskii-Poisson equation. For (M h )min < M h < (M h ) * = 3.30 × 10 9 M the soliton is surrounded by a tenuous isothermal atmosphere without plateau. For M h > (M h ) * we find two branches of solutions corresponding to (i) pure isothermal halos without soliton and (ii) isothermal halos harboring a central soliton and presenting a plateau. The purely isothermal halos (gaseous phase) are stable. For M h > (M h )c = 6.86 × 10 10 M , they are indistinguishable from the observational Burkert profile. For (M h ) * < M h < (M h )c, the deviation from the isothermal law (most probable state) may be explained by incomplete violent relaxation, tidal effects, or stochastic forcing. The isothermal halos harboring a central soliton (core-halo phase) are canonically unstable (having a negative specific heat) but they are microcanonically stable so they are long-lived. By extremizing the free energy (or entropy) with respect to the core mass, we find that the core mass scales as Mc/(M h )min = 0.626 (M h /(M h )min) 1/2 ln(M h /(M h )min). For a halo of mass M h = 10 12 M , similar to the mass of the halo that surrounds our Galaxy, the solitonic core has a mass Mc = 6.39×10 10 M and a radius Rc = 1 kpc. The solitonic core cannot mimic by itself a supermassive black hole at the center of the Galaxy but i...