You will want to look at the wp-discourse plugin, which provides out of the box functionality for using discourse and wordpress together. It works really well!
I have not done the forum in a folder, but there are some topics here about it. Honestly, my advice to you would be to keep it simple and just have discourse on a subdomain, on a separate server. It will save you alot of pain.