Hi, Monalisa! Dharamshala experiences cold weather conditions during December, but it's completely safe for solo travellers as the daytime temperatures are pleasant and the views of the surrounding Dhauladhar range are absolutely incredible.
You may check out the following link to read more about the experiences of solo travellers in Dharamshala: https://www.tripoto.com/trip/ideal-destination-for-solo-travelers-dharamshala-mcleodganj-and-triund-trek-764229
Yes, Dharamshala should be safe to travel during December. It gets colder, but is usually brimming with tourists from all over the country. You would definitely enjoy! :)