Your dragon could be insulated on the outside, and roll and slide around on dry ground. It could charge itself up with static electricity. Just like scuffling along in slippers on a winter day, then gently touching your brother on the ear. Scuffling thru the air counts - fine particles scuffling thru the air and collecting charge is where lightning comes from and the principle of air scuffling conferring charge is why planes have little lightning rods on them: to disperse accumulated charge.
Sharp edges tend to bleed off charge and so for this method it would be advantageous for your dragon to be very round, or possibly like the Michelin Man. A nearly spherical dragon or lozenge shaped dragon would be ideal for this.
A problem: on touching something grounded with some body part that is not insulated (tongue?) the dragon gets an equivalent shock.
A solution is to have the dragon spit or otherwise launch discrete boluses of dispensable matter from its body towards the target. A lugey of electrolyte and mucus will carry some charge as it leaves and on hitting the grounded target, impart that charge. The dragon is not part of the circuit. This method also allows the dragon to parcel out charge in several shots as opposed to dumping it all at once (still possible via tongue method).
It was pointed out to me that rather than scuffling on carpet or through the sky, the electric dragon could accumulate charge by rubbing itself - much like one might rub a balloon on a child head to make her hair stand up, or accidentally shocking a dog or cat after accumulating charge by petting it. I can imagine this rounded dragon rubbing itself briskly immediately before launching a gooey charged blast at its prey.