I will share some information with you, based on two things you mentioned:
a) You said your advisor is very aggressive and loves to make racist jokes
b) You suspect your advisor soured your postdoc application through negative remarks to your prospective employer
This sounds like a situation which might be investigatable by the Office for Civil Rights (OCR), if your PhD institution receives any federal funds.
If you decide you would like this investigated by OCR, you would need to file a complaint within 6 months of becoming aware of alleged discrimination. A complaint of this kind can be filed by an individual working alone without a lawyer.
You might be able to find a lawyer would would help you with the complaint pro bono (free) or with a reduced cost.
It would be helpful to cite as much specific information about (a) as possible. However, you can send the complaint letter quickly and then submit more specific information subsequently. It can be helpful to file these complaints quickly rather than not quickly, because some regional OCR offices are extremely backed up.
If OCR feels that your complaint letter fits with their purview, and meets some other basic requirements, but your letter doesn't include specific information such as dates of incidents and descriptions of incidents, then you will be asked to provide specifics.
If you want to learn more about this: https://www2.ed.gov/about/offices/list/ocr/docs/howto.html
The part I feel most unsure about is the employment aspect. However, the How-To page I linked to mentions
Some of the civil rights laws enforced by OCR also extend to employment.
Each university has an office that addresses discrimination issues, so you could in principle bring the issue to them. However, many people have found it more effective to either go ahead and file with OCR, or draft an OCR complaint and share the draft with the institution (as a draft).
Alternatively, you could instead try an informal approach: make an appointment with a department administrator and share your concern. The response you get could help you decide about next steps. Here's a relatively gentle way of starting such a conversation:
I had a job interview that seemed to be going great --until suddenly it wasn't going great any more. I'd like to get some constructive feedback so that I can do better in subsequent interviews. But it would be awkward for me to ask my advisor directly for feedback. (Answer truthfully but with a very neutral tone if you're asked why.) Can you help facilitate me getting some constructive feedback from Prof. So-and-So (your advisor)?
If you're part of a graduate student union, it might be helpful to bring the problem to them to see if they can provide support.
**11/25 additional notes 11/25:
Your university may have an all-purpose grievance procedure that can be used in general situations, even when there's no alleged racial discrimination.
In the answer I wrote yesterday I was only providing information. Now I'll provide a couple of strategy notes. If I were in your shoes I would probably start with the informal approach I outlined yesterday, and try to keep it in the department. I'd avoid using any language that might alarm the department administration, and keep the tone very calm and neutral. But at the same time, I'd be working quietly on collecting evidence and witnesses, and starting to draft a complaint. Putting the facts down on paper can be an extremely useful exercise.
I recommend that you avoid escalating your concern beyond your department. But if your university chooses to do so, I'd recommend you do one of the following, pretty quickly:
(a) find an ally or a lawyer
(b) submit a complaint to OCR
(c) submit a draft OCR complaint to your university
Reason: some universities play hard ball. It would be safest to protect yourself in case your university turns out to be one of those.
If I had strong evidence for the racism allegations, and did not have an ally or a lawyer, I would likely go with (c). A draft complaint could give you some useful leverage. When OCR investigates, it requires that the university submit a lot of documentary evidence (both about your particular situation, and also about its policies and procedures), and it conducts interviews. Institutions generally find this onerous and often would prefer to resolve the potential complainant's concerns pretty quickly, in order to prevent an OCR complaint from being filed.
Note that filing an OCR complaint provides protection against retaliation.
Note also that it can be a frustratingly slow process. Therefore it would be good to try to get your goals clear before you talk to anyone. I imagine your goals at this point are
Graduate
Get a post-doc
I hope you find a good administrator in your department.