Install ghost blog on Hashicorp Nomad

Install ghost blog on Hashicorp Nomad

This blog is running under a Hashicorp Nomad Cluster.

If you wish to create your own ghost blog, probably you found some content about how to run it under docker or even kubernetes, I created this blog post to help you to create your ghost blog on a hashicorp nomad cluster.

I won't expend much time to tell you how hashicorp nomad works, but I can say you can run nomad as a pure orchestrator, and could be an alternative to kubernetes for example.

Ghost run with a front-end website container and a database, here are the configuration of ghost on hashicorp nomad:



In order to maintain the volumes and scale up containers without loose data, I added a persistent volume to each project. This configuration was made in nomad.hcl config, below I am sharing the nomad.hcl file from one of the nodes.

data_dir = "/opt/nomad"

bind_addr = "0.0.0.0"

server {
  enabled          = true
  bootstrap_expect = 3
#  job_gc_threshold = "2m"
}

datacenter = "dc1"

region = "dc1"

advertise {
  http = "100.75.228.121"
  rpc  = "192.168.31.217"
  serf = "192.168.31.217"
}

plugin "raw_exec" {
  config {
    enabled = true
  }
}

client {
  enabled           = true
  network_interface = "tailscale0"
  servers           = ["192.168.31.216"]
  host_volume "php_app" {
    path = "/mnt/storage_test"
    read_only = false
  }
  host_volume "mysql" {
    path = "/mnt/storage_test/mysql"
    read_only = false
  }
  host_volume "ghost" {
    path = "/mnt/storage_test/ghost"
    read_only = false
  }
  #host_network "internet_test" {
  #  #cidr = "12.13.14.15/32" 
  #  interface = "eth1"
  #}
}

consul {
  address = "127.0.0.1:8500"
}

telemetry {
  collection_interval = "1s"
  disable_hostname = true
  prometheus_metrics = true
  publish_allocation_metrics = true
  publish_node_metrics = true
}

Also, if you want to colaborate to the project, you can follow my github project.