Extracted from dokku-alt project