Ghost 1.0+ and Docker

August 19, 2017

By now, I think it well known that Ghost 1.0+‘s direction of easy installation is great for the average user (although I feel that is up for dispute, I never had any problems getting <1.0 up and running), but far less flexible for everyone else.

With a (lot) of effort, I completed my own ghost 1.6.2 Dockerfile that uses my own configuration.production.json, and storage-adapter. While the Dockerfile is messy, I will/am kind enough to provide a simple copy of what works for me.

Is it ideal? Hell no. Does it work? Yes. You’ll need the Dockerfile and my config.production.json to substitute your environment variables during build. For extra clarity, I’ve also provided a docker-compose.yml to illustrate the environment variables the Dockerfile expects.

Download: https://cdn.galaco.me/blog/2017/08/ghost_docker.zip

Assuming you plan on using mysql, mailgun & s3, fill in the environment variables and away you go with docker-compose build, and docker-compose up -d. If you require other services, then it should be clear what modifications are needed to docker-compose.yml, Dockerfile and config.production.json.

It should be noted, I do not advise saving your variables within the docker-compose.yml. Think about security! But this is an example, so modify it for your own needs!