Definitely possible, but it takes a lot of work. A friend has been working on this and said that the difficulty is to get the yeast to produce enough to be commercially viable. Getting it to produce tiny ammounts shouldn't be too difficult. Also note, that these compunds are secreted from the plant cells because they are toxic to the cells in high concentrations, and act anti-microbial IIRC. Hence they won't be healthy for yeast.
In any way, make sure to check your local regulation. I guess, as long as you produce CBD (the non-hallucinogenic medical compound) and no THC, it may be fine in many places.