high Cortisol makes it harder to L-tryptophan to cross the blood-brain barrier.
Plasma cortisol, whose level is increased in depressed patients, decreases free L-tyrosine and free L-tryptophan concentrations in plasma, i.e. the forms which penetrate into the brain.
Also, dehydration makes it harder for L-tryptophan to cross the blood-brain barrier.
an amino acid called tryptophan is required in order for the brain to be able to make serotonin, which is in turn needed to make melatonin. Water is necessary to transport the tryptophan into the brain, and dehydration can limit the amount of available tryptophan.
I don't know about the relationship between cortisol and dopamine. But Dopamine is affected by adrenal fatigue...as shown on this page.