Skip to content

Instantly share code, notes, and snippets.

@duncanmcclean
Last active March 12, 2020 19:14
Show Gist options
  • Save duncanmcclean/e182690e2a9aae0d56ef5f4e1038911d to your computer and use it in GitHub Desktop.
Save duncanmcclean/e182690e2a9aae0d56ef5f4e1038911d to your computer and use it in GitHub Desktop.

Fathom Lite on Heroku

You'll need to run this script on a machine that has the Heroku CLI (and has logged into it), has Git installed, has curl and wget installed and has tar.

Usage

sh heroku-fathom-lite.sh cool-fathom [email protected] P@$$w0rD
# Installs Fathom Lite on Heroku
APPNAME=$1
EMAIL=$2
PASS=$3
heroku create $APPNAME --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git
heroku git:clone -a $APPNAME
cd $APPNAME
mkdir -p bin
curl -s https://api.github.com/repos/usefathom/fathom/releases/latest \
| grep browser_download_url \
| grep linux_amd64.tar.gz \
| cut -d '"' -f 4 \
| wget -qi - -O- \
| tar --directory bin -xz - fathom
echo "web: bin/fathom server" > Procfile
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app/bin \
FATHOM_DATABASE_DRIVER=postgres \
FATHOM_DATABASE_URL=$(heroku config:get DATABASE_URL) \
FATHOM_DEBUG=true \
FATHOM_SECRET=$(openssl rand -base64 32) \
FATHOM_GZIP=true
git add .
git commit -m "Install Fathom Lite"
git push heroku master
heroku dyno:resize hobby
heroku run fathom --version
heroku run fathom user add --email=$EMAIL --password=$PASS
heroku open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment