The story
A compound of Chinese + -man, or a compression of the words "Chinese man" into a single word, which may have been influenced by Chinaman or by similar words such as Englishman, Frenchman and Dutchman.
Etymology from Wiktionary, CC BY-SA 4.0.