Where to set post install hook

Hi,
I’m running discourse in an LXC container which requires me to run

chmod -R go+w /var/www/discourse/tmp/cache

in order to get rails to start correctly. Is there any place I can put this command so it executes after every rebuild/install?