Skip to content

Instantly share code, notes, and snippets.

@gmolveau
Last active February 25, 2025 13:24
Show Gist options
  • Select an option

  • Save gmolveau/78f88af3f5951ba6e093f93a07caa302 to your computer and use it in GitHub Desktop.

Select an option

Save gmolveau/78f88af3f5951ba6e093f93a07caa302 to your computer and use it in GitHub Desktop.

Revisions

  1. gmolveau revised this gist Mar 10, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fathom_to_heroku.md
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ heroku config:set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/
    FATHOM_DATABASE_DRIVER=postgres \
    FATHOM_DATABASE_URL=$(heroku config:get DATABASE_URL) \
    FATHOM_DEBUG=true \
    FATHOM_SECRET= $(openssl rand -base64 32) \
    FATHOM_SECRET=$(openssl rand -base64 32) \
    FATHOM_GZIP=true
    ```

  2. Grégoire MOLVEAU revised this gist Feb 11, 2019. 1 changed file with 24 additions and 13 deletions.
    37 changes: 24 additions & 13 deletions fathom_to_heroku.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,17 @@
    # Fathom on Heroku
    # Deploy Fathom on Heroku

    * heroku cli + git + curl + wget + tar are required
    * openssl is required to generate the secret_key, but you can change to something else
    ### Requirements

    * heroku cli (logged in)
    * git
    * curl
    * wget
    * tar are required
    * ~ openssl is required to generate the secret_key, but you're free to use what you want

    ### Create the app

    First you need to choose a unique app name, as Heroku generates a subdomain for your app.

    * create the app via the buildpack

    @@ -16,13 +26,13 @@ heroku git:clone -a UNIQUE_APP_NAME
    cd UNIQUE_APP_NAME
    ```

    * create the folder that will contain our binary
    * create the folder that will contain fathom

    ```bash
    mkdir -p bin
    ```

    * download latest version of fathom
    * download latest version of fathom for linux 64bit

    ```bash
    curl -s https://api.github.com/repos/usefathom/fathom/releases/latest \
    @@ -33,20 +43,22 @@ curl -s https://api.github.com/repos/usefathom/fathom/releases/latest \
    | tar --directory bin -xz - fathom
    ```

    * create the Procfile for heroku
    * create the Procfile for Heroku

    ```bash
    echo "web: bin/fathom server" > Procfile
    ```

    * create a Postgres database
    * create a Postgres database (you can change the type of plan if you want - https://elements.heroku.com/addons/heroku-postgresql#pricing)

    ```bash
    heroku addons:create heroku-postgresql:hobby-dev
    ```

    * update the environment variables, generate a secret_key

    here you can change the way you generate your secret_key.

    ```bash
    heroku config:set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app/bin \
    FATHOM_DATABASE_DRIVER=postgres \
    @@ -64,15 +76,14 @@ git commit -m "First Commit"
    git push heroku master
    ```

    heroku ps:scale web=1
    * a free-tier dyno uses the hours pool, if you have other free dynos running, you will need to upgrade to a hobby
    * - https://www.heroku.com/pricing
    * the created app runs as a free-tier. A free-tier dyno uses the account-based pool
    of free dyno hours. If you have other free dynos running, you will need to upgrade your app to a 'hobby' one. - https://www.heroku.com/pricing

    ```bash
    heroku dyno:resize hobby
    ```

    * check if everything works
    * check that everything is working

    ```bash
    heroku run fathom --version
    @@ -84,10 +95,10 @@ heroku run fathom --version
    heroku run fathom user add --email="test@test.com" --password="test_password"
    ```

    * open the browser to connect and create your first website
    * open the browser to login and add your first website

    ```bash
    heroku open
    ```

    * ENJOY :)
    * ENJOY :)
  3. Grégoire MOLVEAU revised this gist Feb 11, 2019. No changes.
  4. Grégoire MOLVEAU renamed this gist Feb 11, 2019. 1 changed file with 54 additions and 16 deletions.
    70 changes: 54 additions & 16 deletions fathom_to_heroku.sh → fathom_to_heroku.md
    Original file line number Diff line number Diff line change
    @@ -1,55 +1,93 @@
    # heroku cli + git + curl + wget + tar are required
    # openssl is required to generate the secret_key, but you can change to something else
    # Fathom on Heroku

    # create the app via the buildpack
    * heroku cli + git + curl + wget + tar are required
    * openssl is required to generate the secret_key, but you can change to something else

    * create the app via the buildpack

    ```bash
    heroku create UNIQUE_APP_NAME --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git
    ```

    # locally clone the newly created app
    * locally clone the newly created app

    ```bash
    heroku git:clone -a UNIQUE_APP_NAME
    cd UNIQUE_APP_NAME
    ```

    * create the folder that will contain our binary

    # create the folder that will contain our binary
    ```bash
    mkdir -p bin
    ```

    # download latest version of fathom
    * download latest version of fathom

    ```bash
    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
    ```

    * create the Procfile for heroku

    # create the Procfile for heroku
    ```bash
    echo "web: bin/fathom server" > Procfile
    ```

    * create a Postgres database

    # create a Postgres database
    ```bash
    heroku addons:create heroku-postgresql:hobby-dev
    ```

    # update the environment variables, generate a secret_key
    * update the environment variables, generate a secret_key

    ```bash
    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
    ```

    * add, commit and push all our files

    # add, commit and push all our files
    ```bash
    git add --all
    git commit -m "First Commit"
    git push heroku master
    ```

    heroku ps:scale web=1
    # a free-tier dyno uses the hours pool, if you have other free dynos running, you will need to upgrade to a hobby
    # - https://www.heroku.com/pricing
    * a free-tier dyno uses the hours pool, if you have other free dynos running, you will need to upgrade to a hobby
    * - https://www.heroku.com/pricing

    ```bash
    heroku dyno:resize hobby
    ```

    # check if everything works
    * check if everything works

    ```bash
    heroku run fathom --version
    ```

    * add the first user

    # add the first user
    ```bash
    heroku run fathom user add --email="test@test.com" --password="test_password"
    ```

    * open the browser to connect and create your first website

    # open the browser to connect and create your first website
    ```bash
    heroku open
    ```

    # ENJOY :)
    * ENJOY :)
  5. Grégoire MOLVEAU revised this gist Feb 11, 2019. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions fathom_to_heroku.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    # heroku cli + git + curl + wget + tar are required
    # openssl is required to generate the secret_key, but you can change to something else
    # go to a temporary folder
    cd /tmp

    # create the app via the buildpack
    heroku create UNIQUE_APP_NAME --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git
  6. Grégoire MOLVEAU revised this gist Feb 11, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions fathom_to_heroku.sh
    Original file line number Diff line number Diff line change
    @@ -51,5 +51,7 @@ heroku run fathom --version
    # add the first user
    heroku run fathom user add --email="test@test.com" --password="test_password"

    # open the browser to check if everything is fine
    heroku open
    # open the browser to connect and create your first website
    heroku open

    # ENJOY :)
  7. Grégoire MOLVEAU revised this gist Feb 11, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion fathom_to_heroku.sh
    Original file line number Diff line number Diff line change
    @@ -40,8 +40,9 @@ git add --all
    git commit -m "First Commit"
    git push heroku master

    # choose a "hobby" dyno (because in free tier the dyno goes to sleep) -https://www.heroku.com/pricing
    heroku ps:scale web=1
    # a free-tier dyno uses the hours pool, if you have other free dynos running, you will need to upgrade to a hobby
    # - https://www.heroku.com/pricing
    heroku dyno:resize hobby

    # check if everything works
  8. Grégoire MOLVEAU revised this gist Feb 11, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion fathom_to_heroku.sh
    Original file line number Diff line number Diff line change
    @@ -40,8 +40,9 @@ git add --all
    git commit -m "First Commit"
    git push heroku master

    # add a dyno (because in free tier the dyno goes to sleep) -https://www.heroku.com/pricing
    # choose a "hobby" dyno (because in free tier the dyno goes to sleep) -https://www.heroku.com/pricing
    heroku ps:scale web=1
    heroku dyno:resize hobby

    # check if everything works
    heroku run fathom --version
  9. Grégoire MOLVEAU revised this gist Feb 11, 2019. No changes.
  10. Grégoire MOLVEAU revised this gist Feb 11, 2019. No changes.
  11. Grégoire MOLVEAU created this gist Feb 11, 2019.
    53 changes: 53 additions & 0 deletions fathom_to_heroku.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    # heroku cli + git + curl + wget + tar are required
    # openssl is required to generate the secret_key, but you can change to something else
    # go to a temporary folder
    cd /tmp

    # create the app via the buildpack
    heroku create UNIQUE_APP_NAME --buildpack https://github.com/ph3nx/heroku-binary-buildpack.git

    # locally clone the newly created app
    heroku git:clone -a UNIQUE_APP_NAME
    cd UNIQUE_APP_NAME

    # create the folder that will contain our binary
    mkdir -p bin

    # download latest version of fathom
    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

    # create the Procfile for heroku
    echo "web: bin/fathom server" > Procfile

    # create a Postgres database
    heroku addons:create heroku-postgresql:hobby-dev

    # update the environment variables, generate a secret_key
    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

    # add, commit and push all our files
    git add --all
    git commit -m "First Commit"
    git push heroku master

    # add a dyno (because in free tier the dyno goes to sleep) -https://www.heroku.com/pricing
    heroku ps:scale web=1

    # check if everything works
    heroku run fathom --version

    # add the first user
    heroku run fathom user add --email="test@test.com" --password="test_password"

    # open the browser to check if everything is fine
    heroku open