Git Product home page Git Product logo

ghost-on-docker's Introduction

ghost-on-docker

Ghost

Pair Docker and Ghost for the perfect platform to run your blog!

Find out more about Ghost here

Ghost is an elegant and minimal blogging platform that focus on simplicity. One of its most attractive features is its Markdown editor. It's also fully hackable running on Node.js with the Handlebars view-engine.

This project is work-in-progress but all the blog images are fully working

Ghost 1.0

Ghost 1.0 was released in July 2017 you can find the Dockerfile here and a Getting Started blog post here.

For now I'd still recommend using Ghost 0.11.x which has better support for running in Docker under a known configuration. Check back soon for more on Ghost 1.0.

Ghost 0.11.x

The rest of these instructions are for the version of Ghost running at https://blog.alexellis.io and many other sites.

Getting started

You can pull the ARMv7 image (for PI2/3) straight from the Docker Hub docker pull alexellis2/ghost-on-arm:armv7. The image for your PC, laptop or cloud host is - alexellis2/ghost-on-docker:latest.

To get the latest and greatest versions you can build your own image using the Dockerfile provided. If you'd like to help maintain or test new versions please do so through pull requests.

Please support the project by giving it a Star.

Dockerfiles

These are all based upon Node 4.x, pick the architecture for your computer/server. If you are using a regular PC it will be the first option marked x86_x64. Each image has been pushed to the Docker hub, the npm modules alone for Ghost take up around 500MB, but the download will be faster than a fresh build if you use a Raspberry PI.

  • Regular PC/Laptop - x86_x64
  • Dockerfile
  • Based upon Alpine Linux
  • Very fast build time and high amount of requests/per second compared to a Raspberry PI, my Core i5 NUC with 16GB RAM running a single container gave around 85-90 requests/per second.

Example usage:

$ docker run --name blog -d -p 80:2368 alexellis2/ghost-on-docker:latest

Or use the recently added Docker Compose file for even less fuss:

$ docker-compose up -d
  • ARMv7 (Raspberry PI 2 / 3)
  • Dockerfile
  • Building SQLite npm module on PI 2 takes about 7 minutes
  • semver and other required modules will take quite some time
  • Once up and running can handle 12-16 requests per second
  • Nginx is beneficial as a cache (dramatically improving requests/per second), but not absolutely necessary.

Example usage:

$ docker run --name blog -d -p 80:2368 alexellis2/ghost-on-docker:armv7
  • ARMv6 (Raspberry PI A/B/B+/Zero)
  • Dockerfile
  • Note: ARMv6, especially models with < 512mb RAM will require a swapfile for building the SQLite npm module. Creating SWAP file
  • Building SQLite npm module on PI Zero takes about 16 minutes
  • Once up and running performs 2-3 requests per second, use of Nginx or another cache is highly recommended.

Example usage:

$ docker run --name blog -d -p 80:2368 alexellis2/ghost-on-docker:armv6

Benchmarking

One of the simplest ways you can benchmark your blog is to use Apache Bench. It has a very simple CLI, here's an example load:

On the Docker host:

$ docker run --name blog -d -p 80:2368 alexellis2/ghost-on-docker:latest
5c71cdf984fefc7b508e8ee0f0d82c389ee492a339f7df23be95a61e83340156

From another PC:

$ ab -c 4 -n 1000 http://192.168.0.240/
  • -c 4 means 4 concurrent requests, simulating three users hitting the page at exactly the same time
  • -n 1000 means 1000 requests, so each of the 4 users will hit the page a portion of that time. i.e. 250 requests each.

You can play with the numbers to see how the blog performs under different conditions, you could also try typing in docker stats to see what kind of load the Docker container is creating.

Taking it further

  • Learn how to apply caching on your blog with NGinx.

Boost your site's performance and save money with NGinx

  • Use Docker volumes to safely upgrade your blog and preserve your data

Keeping Shipping your blog with Docker volumes

There is also an example docker-compose.yml file in this repository which you can use as a template for mounting a persistent volume.

Questions/comments?

Head over to my blog and post a comment/question, or if you've found a bug raise an issue on Github.

See also:

Just want to learn Docker?

Start learning today with a dozen progressive labs with my Hands-on Docker tutorial

How I self-host my blog for free

Self-hosting on a Raspberry PI

How I use dynamic DNS for alexellis.io

ghost-on-docker's People

Contributors

alexellis avatar hermanzdosilovic avatar johncrisostomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ghost-on-docker's Issues

impossible to publish

hello
i deployed this containers with docker compose on Ras pi 3
Always is ok , except when i want publish : impossible to publish , the button becomes red and the article is not published
an idea ?
Thanks

Using Data Volumes

Which directory would we want to map a data volume to if we want to persist our data outside of the container, but still be able to easily update the container when new versions are released?

What is sed in your Dockerfile?

Hello, I'm trying to understand what you did in your Dockerfile but I don't find any reference for the sed command.

RUN sed -i s/my-ghost-blog.com/blog.alexellis.io/g config.js

I assume it's a third party software?

Unable to access admin

Hi,

I've followed the steps described in your blog post. The ghost site is running, and accessible at http://localhost:2368. However trying to access the admin page at http://localhost:2368/ghost raises the following error:

Error: No default engine was specified and no extension was provided.
    at new View (/var/www/ghost/versions/1.4.0/node_modules/express/lib/view.js:62:11)
    at EventEmitter.render (/var/www/ghost/versions/1.4.0/node_modules/express/lib/application.js:570:12)
    at ServerResponse.render (/var/www/ghost/versions/1.4.0/node_modules/express/lib/response.js:971:7)
    at HTMLErrorRender (/var/www/ghost/versions/1.4.0/core/server/middleware/error-handler.js:86:9)
    at Layer.handle_error (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:315:13)
    at /var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:275:10)
    at prepareError (/var/www/ghost/versions/1.4.0/core/server/middleware/error-handler.js:58:5)
    at Layer.handle_error (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:315:13)
    at /var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:315:13)
    at /var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/1.4.0/node_modules/express/lib/router/index.js:275:10)
    at /var/www/ghost/versions/1.4.0/node_modules/express/lib/response.js:424:7
    at SendStream.onerror (/var/www/ghost/versions/1.4.0/node_modules/express/lib/response.js:1003:5)

Any leads on how to solve this? :-)
Thanks!

armv7 image is outdated

Spinning up the armv7 image and proceeding to the admin section produces "Ghost 0.11.8 is available! Hot Damn. Click here to upgrade."

Problem building ARMv7 image on RBpi3

npm ERR! Linux 4.9.35-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! path /var/www/ghost/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/var/www/ghost/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles' -> '/var/www/ghost/node_modules/ansi-styles'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/ghost/npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.