I will be explaining the process to deploy your Dashboards or any Julia web applications using a free service like Heroku. This is also a part of my Google Code-in task. So, let's get started :)
You'll need two things before moving ahead.
Your Dashboards application files.
You can create a Heroku account on their site.
Once you've both of these things move to Step 2.
You need to install Heroku CLI. You can refer to their official documentation for the detailed instructions.
You should then login to your account using the following command:
$ heroku login
It will open up your browser to enter your credentials or just with a single button to Log in. Once you've done that, you can close that window and you'll find yourselves logged in on the CLI.
You can create either by CLI or move to your dashboard and click on
New. This will ask you the application name and location. Just select any meaningful name which is available and move on. Let's assume here your app name is
I'm assuming you already have a working Dashboards application. So, create a new folder anywhere to manage your heroku deployment. To demonstrate I'm using
sample-app as directory for my app.
Copy all the files of your Dashboards application to
Once you've done that, you can do following operations to link it with your heroku app.
git heroku git:remote -a sample-app-heroku
Remember to replace
sample-app-heroku to whichever name you've used while creating your app on Heroku.
You need two files to manage your dependencies. You can simply copy your existing Project.toml file from
$HOME/.julia/environments/v1.3/Project.toml and Manifest.toml file from
Your Julia version might be different hence, make sure to change the
v1.3 to your corresponding Julia version.
Also, add a
Procfile to the directory, containing following:
web: julia --project app.jl $PORT
app.jl represents your entry point for your application.
$PORT represents the PORT number heroku will be using for your application. You must parse this PORT number on your script before starting the server.
Heroku won't be able to detect Julia application automatically, hence we'll need to add custom buildpack to the app. You can do this by moving to your app settings page on heroku site and on the buildpack row, add this:
This will take care of installing all dependencies required.
Now since all files are ready, just commit those files and push to heroku.
Follow the below commands:
git add -A
git commit -m "Initial push"
git push heroku master
You'll see the application building dependencies and once the process completes the application will be live!
I hope this will make your process of deploying apps easier. You can deploy any web apps this way (not just limited to Dashboards).