Footer to bottom of page

We need the page footer to be at the bottom of the page. However, it should not always stick to the bottom of the page either i.e. when there is more than one page worth of content. Thanks to flexbox, this is not so hard after all.