Azuracast: One-click Web Radio in the Reclaim Cloud

Yesterday was a win because I finally focused for long enough to work through creating a one-click installer for the open source web radio application Azuracast. I’ve had a couple of conversations with folks around web radio this week, and I have to say it was cool to hear them suggest web radio is one area they want to explore. I love the whole idea, and I figured Reclaim Hosting could do its small part to make installing and hosting Azuracast that much easier. I have played with the software a bit in Reclaim Cloud to create Reclaim Radio, stand-up Strawboss Radio for the inimitable @scottlo, and finally to migrate #ds106radio to Azuracast. So I had installed the software using their Docker container a few times now.

The trick was to take the installation commands and create a one-click installer for Reclaim Cloud. Tim has already created quite a few, and he wrote-up a bit about the approach for creating packages on the Reclaim Community forums that was a very useful starting point:

Jelastic has documentation at https://docs.cloudscripting.com/ on how to develop these packages which take the form of a yaml or json file. You can also browse all of the packages currently available via Jelastic’s Github organization at Jelastic JPS Collection as well as recent additions I’ve built and added to the Marketplace at Reclaim Hosting’s Github. The repos contain a manifest.yaml file which has all of the necessary code. In more complex scripts that file may call other scripts within the repo to do various things.

One method I’ve had a lot of success with is creating a generic Docker container and then running a build script to automate pulling down and running the particular software project.

Tim points to the example of the manifest file for RStudio he created as a model, which is where I started. I created my first Github repo in the Reclaim Hosting account (which is a proud moment for me 🙂 ) and I got started. And, in fact, it was pretty simple, I had to update the application name and other details, but the only real significant change to the RStudio manifest he shared was to the actions section:

actions:
  setup:
    cmd[cp]: |-
      mkdir -p /var/azuracast
      cd /var/azuracast
      curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/master/docker.sh > docker.sh
      chmod a+x docker.sh
      yes no |./docker.sh install
      #Checking of container is up and running
      until [ "`/usr/bin/docker inspect -f {{.State.Running}} azuracast_web`"=="true" ]; do
        sleep 1
        print '.'
      done;
      echo OK
ssl: true
skipNodeEmails: true
success: |
  **Azuracast URL**: [https://${env.domain}/](https://${env.domain}/)

This is the finished product, but to be clear it took some finessing of my attempt by Tim to get it to work. The big thing was that the Docker container asks questions about the custom domain and SSL certification to creating and environment file, so that had to be forced in the script with the line yes no |./docker.sh install. The other thing is the test to make sure the container is running until [ "`/usr/bin/docker inspect -f {{.State.Running}} azuracast_web`"=="true" ]; do needs the name of the application for that Docker instance, which is azuracast_web, so that was another thing Tim helped me figure out.

That said, I can see how creating these one-click installer can be pretty do-able with the right container, which is pretty awesome. Even better, it is not necessarily limited to us creating these manifests, as Tony Hirst demonstrated with his Jupyter Notebook work, anyone can do it and share appropriating for others to use, where or not it is in our marketplace. So, all that said, I finally have my first attempt at an installer for Reclaim Cloud under my belt.