This tutorial will show you how to deploy your Clojure app in several minutes. These instructions will also give you enough information to make the most out of Dokkur.
Be sure that you already have:
In this step you will install the Dokkur Toolbelt that gives you you access to the Dokkur Command Line Interface (CLI).
After installation you can use dokkur login command to log in with your email and password you set when creating Dokkur account.
Prepare the app
To deploy an app you need to have the app prepared for deployment.
If you don’t have your own Clojure project, you can use a template that we have already prepared for you:
$ git clone https://github.com/dokkur/clojure-getting-started.git
$ cd clojure-getting-started
If you have a Clojure app that you want to deploy, you need to do some preparations.
Declare app dependencies
How does Dokkur recognize an app as a Clojure app? The answer is by the existence of a project.clj file in the root directory.
It may look something like this:
(defproject clojure-getting-started "1.0.0-SNAPSHOT"
:description "Demo Clojure web app"
:name "Eclipse Public License v1.0"
The project.clj file is a specification of which dependencies should be installed with your application including version of Clojure.
Create a new app
Follow these steps:
- Open website, go to Personal apps (left menu bar)
- Click ⨁ button to open New App interface
- Enter the app’s name (Caution! Use latin lowercase and numbers, e.g. myapp007), choose available and convenient instances for hosting, pick Custom App template and press Create App button.
Congrats! Your app has easily been created. Now you need to deploy it. Just do it!
Add BUILDPACK_URL config var
- Go to Settings page, in Environmental variables section click on Edit button.
- Choose ADD NEW VARIABLE
- In the Name field write BUILDPACK_URL
- In the VALUE field put
- Save settings
Deploy your app
- Go to Settings page, copy the app git url from the Git URL section.
- Switch to Dokkur Toolbelt and execute this command:
git remote add dokkur git_urlInstead of git_url paste your app's git url.
- Push your app:
git push dokkur masterIf you want to deploy another branch, run:
git push dokkur yourbranch:master
Hell yeah! Your app is deployed! Open yourappname.dokkurapp.com in your browser.