I was debating with some people about the term "coolie" being racist, and a number of Americans aren't aware of the racist past of the word, likely because it is long obsolete. That got me wondering more about it's history, and usage. A bit of google searching indicates that it is applied to more groups than just Chinese, which got me even more curious.
I don't think it's uniformly racist, it kind of depends on where you are and whom the word is used by.
I think the word originates in Indian languages. In India, a "coolie" is a manual laborer, particularly one who carries heavy loads. At pretty much every railway station in India, you will find red-shirted coolies whose job it is to carry luggage. You can hire a coolie to carry your suitcases and load them into your train carriage or the luggage compartment. There are also coolies at places like dockyards or truck shipping stations -- it's sort of the generic word for someone who carries/loads/unloads goods.
It is not considered a racist word in India. You can ask for a "coolie" at railway stations. Coolies are licensed by the stations and in addition to the red shirt, they carry a metal badge with their ID number. The badge also says "coolie", since that is in fact the word they use to refer to themselves.
I think the racist usage is in countries where Indian or Chinese manual laborers ended up, such as plantations on former British colonies in Jamaica or Central/South Americas or South Africa. These are places where the British imported a lot of manual laborers from India, southeast Asia and China, who were referred to as "coolies" at the time, and since then it has become a derogatory term Asians/Indians in general.
The word "coolie" itself originated either from the Chinese language (or to be more specific southern Chinese) or from south Asia. The word "苦 力", pronounced "ku li", means "forcefully using strength".
In the 19th century this word started to be used in many places in south Asia and southeast Asia to address laborers. It spanned both British India and Dutch Indonesia, with Malaysia and Singapore in between. It is still used today in Indonesia and Malaysia, mostly with no racist connotation, as it addresses a particular vocation. In some instances it can be considered derogatory but not in a racist way.
At the same time in the 19th century, western colonial powers started to use indentured laborers from southern China, the Malay world, and India, to provide manpower to their colonies elsewhere. This includes Cuba, South Africa, the Americas, Australia. So the use of the term "coolie" spread following the growing trade in indentured laborers. In these places, since "coolie" is strongly associated with a specific race of people, the term can be considered, and is used in, a racist context.