How to Install Ghost Node JS Blog with Docker on Supergiant

Posted by Mark Brandon on May 10, 2016


Hello, this is Mark Brandon, CEO and Co-Founder of Qbox, the creators of Supergiant.  

Today we’re going to show you some of the cool things you can do with Supergiant, namely deploying a blog application straight from Docker Hub into your private Kubernetes environment.

We’re going to start from the Supergiant dashboard, but before we do that, I’m going to find a suitable container for the popular blogging platform, Ghost.

There are several public containers, but fortunately, there is an officially supported container complete with well-documented instructions.

From our dashboard, the first thing I’m going to do is create an App. For simplicity, I’ll just name it “Blog.”

ghost_tut_2.jpg#asset:40Now we have an empty app.  Apps aren’t useful of course until you add components. I’ll name my component “ghost server.”

ghost_tut_3.jpg#asset:41

Components are the key to understanding Supergiant. Within components, you have the data volumes, containers, and container networking. We need to add containers and data volumes.  

I’m going to first add a data volume. We’ll name it ghost-data and give it 40GB of SSD storage.

ghost_tut_5.jpg#asset:43

Now I have a volume, so the next thing I need to do is add my container.  

To specify a docker image, I need to provide a path. If you’re using Docker Hub, you can use the path specified after the pull command. In this case, it is just “ghost.” If I wanted to use another public container, I would use its full path.

ghost_tut_6.jpg#asset:44

Next I will specify a CPU value. Supergiant will automatically scale nodes within this range. Five hundred cores is a lot, but remember we won’t use that much until it’s needed. In actuality, half of one CPU is sufficient to run a medium-sized blog.

Next I’m going to select RAM. By putting a zero in both fields, I’m telling Supergiant to use as much RAM as is available within our giant resource pool and that is required by Ghost at any given moment.

If you have custom commands or environment variables, this is the place to put them, but it’s not necessary for this example.  

ghost_tut_7.jpg#asset:45

We do want to mount the volume we just created. The volume name is ghost-data, and we want to specify the path, according to the instructions.

We need to expose ports and make it public. For this image, 2368 is the appropriate port. The protocol is HTTP. We need to make it public. It’s important to know that Supergiant currently requires this port to be between 30000 and 40000. I’m going to pick a number at random, say, 30211.  

If you designate Public, then it needs to be attached to an entry point. For this install, the entry point is just supergiant.

ghost_tut_8.jpg#asset:46

You’ll notice that the component is still not running. We have to deploy it. To do that, go to Releases, Create a New Release, and then deploy it. After a few seconds, you’ll see this component is now running.  

ghost_tut_9.jpg#asset:47

All we have to do now is put in the address with the port we specified, and voila, we now have a running ghost instance. Users of ghost will recognize this screen.

ghost_tut_11.jpg#asset:48

More importantly, this instance is set to scale up and down according to its needs within the confines of our resource allocations, giving us both performance and cost efficiency.

For more information, check out our documentation, join our slack channel, or read the blog. This is Mark Brandon. Thanks for watching.

comments powered by Disqus