I wouldn't bother unless its a spare board that you don't like to use. You need the most rock solid board possible for foiling and its good to get a bit of flex in a surf board. You'll end up with a compromise that isn't as good for either.
If you still want to go ahead, the
best way is to buy one of these:
www.gong-galaxy.com/en/product/gong-mount-track-box-reinforced-for-top-plate/Then cut a hole in the foam of the bottom and glass it in.
The
cheap way is to drill 4 holes all the way through the board. Then glass in some tubes and screw through from top to bottom onto the mast.
The
easy way is one of those sticky pads like this:
actionsportswa.com.au/product/foilmount/Although then you won't be able to use it like a surfboard till you peel off the adhesive.