Skip to content

Instantly share code, notes, and snippets.

@ssuprunenko
Last active December 10, 2015 12:07
Show Gist options
  • Select an option

  • Save ssuprunenko/6bbda491804ab2e00ff7 to your computer and use it in GitHub Desktop.

Select an option

Save ssuprunenko/6bbda491804ab2e00ff7 to your computer and use it in GitHub Desktop.

Revisions

  1. ssuprunenko revised this gist Dec 10, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions deploying_elixir_mix_project_on_dokku.md
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,11 @@ Ensure your locale is set to UTF-8:
    $ dokku config:set app_name LC_ALL=en_US.utf8
    ```

    Set prod env:
    ```
    $ dokku config:set app_name MIX_ENV=prod
    ```

    Put any ENV keys to app config:
    ```
    $ dokku config:set app_name SECRET_KEY=secret
  2. ssuprunenko created this gist Dec 10, 2015.
    54 changes: 54 additions & 0 deletions deploying_elixir_mix_project_on_dokku.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    # Deploying Elixir Mix project on Dokku
    ## Setup VPS

    Create clean Ubuntu 14.04 image on Digital Ocean or any other VPS.

    Login to VPS via ssh:
    ```
    $ ssh root@server_ip
    ```

    Install [Dokku](https://github.com/dokku/dokku):
    ```sh
    $ wget https://raw.githubusercontent.com/dokku/dokku/v0.4.5/bootstrap.sh
    $ sudo DOKKU_TAG=v0.4.5 bash bootstrap.sh
    ```

    Create a Dokku app:
    ```
    $ dokku apps:create app_name
    ```

    Make it support multiple buildpacks:
    ```
    $ dokku config:set app_name BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
    ```

    Ensure your locale is set to UTF-8:
    ```
    $ dokku config:set app_name LC_ALL=en_US.utf8
    ```

    Put any ENV keys to app config:
    ```
    $ dokku config:set app_name SECRET_KEY=secret
    ```

    ## Add changes to your git repository on local computer

    Create .buildpacks file:
    ```
    $ echo "https://github.com/HashNuke/heroku-buildpack-elixir.git" >> .buildpacks
    ```

    Ensure you have `prod.secret.exs` in git. Replace all ENV keys with `System.get_env("SECRET_KEY")`

    **Commit changes** and add git remote:
    ```
    $ git remote add dokku dokku@server_ip:app_name
    ```

    Deploy your app to Dokku:
    ```
    $ git push dokku master
    ```