A Habitat plan for packaging Ghost, the excellent blog publishing platform.
https://app.habitat.sh/#/pkgs/cnunciato/ghost
First, install and configure Habitat, then fork the project and clone from your own repository.
Once Habitat is installed and configured with your origin (referred to below as $HAB_ORIGIN
), enter the Habitat studio and build!
hab studio enter
build
hab start $HAB_ORIGIN/ghost
For testing built packages, I've included a Vagrantfile that provisions an Ubuntu VM and starts (via hab pkg start
) the most recently built package. Make sure you run at least one build first:
hab studio run build
... then provision the VM, and in a few moments you should be able to navigate to the newly created blog:
vagrant up
open http://192.168.10.100:2368
You can also export a Docker container and run it either directly:
hab studio run "build && hab pkg export docker $HAB_ORIGIN/ghost"
docker run -it --rm -p 2368:2368 $HAB_ORIGIN/ghost
open http://localhost:2368
... or with Docker Compose:
hab studio run "build && hab pkg export docker $HAB_ORIGIN/ghost"
docker-compose up
open http://localhost:2368
The package supports the following Ghost configuration properties:
- url (string — default:
"http://localhost:2368"
) - mail (object — default:
{}
) - database (object — default is
{ "filename": "ghost.db" }
) - server.host (string — default:
"0.0.0.0"
) - server.port (string — default:
"2368"
)
See the Ghost configuration and Habitat configuration docs for details.
You can also specify a user.toml
, which I find convenient (for example, to apply database or mail-server settings). See docker-compose.yml
for an example of how to do this.
The package is configured to look for its content (apps, images, data and themes) in the $pkg_svc_data_path
directory, so if you've got some themes you'd like to be able to use, just make sure they end up at /hab/svc/ghost/data/themes
, and they should appear in your General tab. See docker-compose.yml
for an example.
It's this!
- https://ghost.org/
- https://ghost.org/developers/ ← downloadable version (on which this package is based)