Deploying Known on a docker stack

To migrate my php applications that did not have a handy docker-compose available, I needed a vanilla setup for my stack-based docker environment. Known is one of those apps and so the first step was to build that PHP environment.

Setting up a Dockerhub repository and building a custom PHP image

[If you decide to use my image, you would not have to build this yourself. Skip ahead to the Deploying Known section]

Most php based apps also need specific extensions built-in. While I am sure they’re out there on the Docker hub repository, I was not able to easily find any images that met my specific needs . So I went ahead and setup my own repository on Docker Hub.

Something I learnt today was that a docker stack only accepts pre-built images. Which essentially means you cannot use the regular build command on the fly in your docker-compose file. A quick work-around to that is to build the image locally and then publish it to a public repository from where the stack can easily access it.

  • Create a dockerfile: sudo nano dockerfile
  • Copy over contents from my dockerfile gist. Edit or update if you need any additional extensions. Do note that I am pulling a debian buster image here. An alpine image would be optimal but lets’ run with this for now.
  • Build the image locally:
    docker build -t sriperinkulam/php-7.4.3-apache-buster-plus:latest .

Edit the image and tag name as needed. If your gist file is defined correctly, the image should be ready in a few minutes. It took me a few iterations to get this working with all the extensions I needed and shouldn’t give you any errors during the build process.

  • Login to your Dockerhub repo: docker login
  • Push your image over to your repository:
    docker push sriperinkulam/php-7.4.3-apache-buster-plus:latest
  • Within a few minutes, your image should be available for easy fetch whenever needed!


Setting up and deploying the Known install

  • Create a folder for the known installation:

sudo mkdir known && cd known

  • Copy over my ‘known.yml’ gist from here and paste into a known.yml file.

sudo nano known.yml

This is where we use the image we built earlier! Make sure you update the passwords there-in.

  • Create an ‘app’ folder. This is where we will copy in the core known package.

sudo mkdir app && cd app

Marcus Povey does the heavy lifting of packaging the known install ‘unofficially’. Download his latest pre-packaged release from his portal.

wget https://withknown.marcus-povey.co.uk/<package>

Finally unzip/untar the package.

  • Step back into the main ‘known’ directory and deploy the stack that we defined in the known.yml file.

cd ..

DOMAIN=known.domain.org SCHEME=https docker stack deploy -c known.yml known

  • Assuming you’ve already setup the traefik container, as mentioned in my Jitsi post, you should now have Known up and running. Navigate to the domain and you should see the warmup page.

  • Key in the db credentials that you setup in the known.yml file. The database would need to be set as mariadb, since that’s how we’ve defined it in the known.yml file. Also make sure you have the Uploads folder writable by www-data:

sudo chown -R www-data /var/www/html/Uploads/

Setup your user account and proceed with the regular administration controls!

Fired up!

Finally got around procuring a pi3 and setup the Nextcloud Box! Getting this up and running was super fun and pretty straight forward.

The OS Image that was delivered with the box was built for the pi2. So I had to format the drive with Gparted and flashed the pi3 image with Etcher (One nifty piece of software!). Once the hardware was fired up, it just took care of itself. The web install was a 1-click setup.

Early this year as I initiated taking more control over my data, I also setup a Nextcloud server on the cloud. It’s been about eight months now and am thoroughly impressed with it. With the incredible iOS and android apps and the nifty client for linux I’m more than convinced the take this a step further and setup my personal home server.

Over the next few weeks as I tinker more with this, I need to make this a more robust setup and make full use of the snappy Ubuntu core.

Debugging and feeds

Realized today that a code fix that I had implemented sometime back, inadvertently introduced a minor bug in my workflow. Will have to get around fixing this sometime later this week.

On another note, I decided to temporarily suspend my self-hosted freshRSS installation and moved my feeds to The Old Reader. Currently I don’t see a huge benefit of self hosting it unless I’m able to implement responding directly from that interface.

Replied to:Hyannis notes | Srikanth Perinkulam

Philip, I dynamically add the ‘Liked:’ and ‘Replied to:’ phrase to the title of the post using some crude code in my back-end. Essentially, I use a couple of workflows to fetch the link/article details and then add the markup et al using a custom functions in my wp install. Would be more than happy to share them if you’re interested in taking a look.

Also I noticed your posts are not marked up with microformats for like and replies. The Indieweb PressThis bookmarklet should ideally add the necessary microformat markup to your posts. For some reason, It doesn’t seem to be doing so. I’ll take a look later today to see what’s transpiring there.

Depending on your publishing preference there are a few other alternatives. Not sure if you’ve explored these already:

  • Quill : Aaron’s posting interface works great on both desktop and mobile devices
  • Omnibear : Keith’s Chrome bookmarklet
  • Using the Bookmarklet Free or URL Forwarder apps on android and tweaking the settings mentioned in one of Chris Aldrich’s notes
  • The WordPress plugin developed by Colin Walker which coupled with his workflows could be used to post from an apple device.

in reply to: Hyannis notes | Srikanth Perinkulam

That previous post was an attempt to “like” this post using IndieWeb Press This. I’d used the tool successfully earlier, but this time I didn’t see the “Liked:” prefix on the post (and I don’t see the “Reply:” prefix on this one).

Replied to:Indieweb for Journalism

Thanks for setting this up, Chris! Some interesting plugins out there on the WP front.

in reply to: Indieweb for Journalism

I’ve been meaning to do it for quite a while, but I’ve finally started a stub in the Indieweb wiki for the topic . There is a rapidly growing group of writers and journalists who have been joining the Indieweb movement, and it’s long overdue to create a list of resources specific to the topic to help out ourselves and others in the future.