I am building a large container for plants, made of pine. Considering that the inside will be in direct permanent contact with moist earth, what is an appropriate treatment to prevent wood deterioration? Would a heavy-duty varnish (e.g., spar varnish) be a good choice?
Would a high-duty varnish (e.g., spar varnish) be a good choice?
In theory yes. In a thick enough coating (numerous full-strength coats) with no voids or pinholes, a varnish like this is essentially waterproof. It could last a long time in this setting although I don't know how the direct soil contact will affect it, to find that out you'd probably be best contacting one of the companies that make varnish and see what they have to say.
You'd get better performance from day one from using an epoxy coating of some kind. They're stronger, more waterproof but unfortunately tend to be quite a bit more expensive than varnish.
To get 100% waterproofing very simply just line with plastic! I would personally do this in addition to treating the interior, just to be on the safe side, but the plastic alone could provide complete protection to the wood if you're careful. Of course you do still need to concern yourself with the top edges and the exterior if you're using common 2x pine to build this, it is not at all a naturally rot-resistant species.