All Projects → aholbreich → docker-ghost

aholbreich / docker-ghost

Licence: other
Docker File for Golden Ghost image

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to docker-ghost

Ghost Matery2
这是又一个采用Material Design和响应式设计的漂亮、简洁且基于Ghost博客的新主题
Stars: ✭ 87 (+443.75%)
Mutual labels:  ghost, ghost-blog
Fizzy Theme
🥤A tasty blogging theme for Ghost.
Stars: ✭ 194 (+1112.5%)
Mutual labels:  ghost, ghost-blog
Ghost Theme Moegi
An elegant & fresh ghost theme.
Stars: ✭ 101 (+531.25%)
Mutual labels:  ghost, ghost-blog
starter
A clean theme for Ghost blog
Stars: ✭ 26 (+62.5%)
Mutual labels:  ghost, ghost-blog
Prometheus
🌈 A Clean And Modern Ghost Theme with Progressive Web Apps (PWA)
Stars: ✭ 94 (+487.5%)
Mutual labels:  ghost, ghost-blog
Gatsby Ghost Balsa Starter
A Gatsby starter for creating blogs from headless Ghost CMS.
Stars: ✭ 17 (+6.25%)
Mutual labels:  ghost, ghost-blog
Setup Ghost Blog
Script to install your own Ghost blog, with Nginx and ModSecurity/Naxsi web application firewall. Supports multiple blogs.
Stars: ✭ 140 (+775%)
Mutual labels:  ghost, ghost-blog
Simply
Theme for Ghost inspired in Medium
Stars: ✭ 336 (+2000%)
Mutual labels:  ghost, ghost-blog
aesto
Free Ghost theme with membership support. Minimal content focused design with multi author supported.
Stars: ✭ 31 (+93.75%)
Mutual labels:  ghost, ghost-blog
Asgar
A two-column, clean and minimalist theme for @TryGhost
Stars: ✭ 22 (+37.5%)
Mutual labels:  ghost, ghost-blog
Ghost On Heroku
One-button Heroku deploy for the Ghost blogging platform.
Stars: ✭ 731 (+4468.75%)
Mutual labels:  ghost, ghost-blog
undefined-ghost-theme
A minimal, Ghost 5.0-ready, membership-enabled starter theme for the Ghost blogging platform.
Stars: ✭ 76 (+375%)
Mutual labels:  ghost, ghost-blog
Mapache
You can use the theme Mapache for ghost in: Blog - Magazine - Landing page - Personal page - Photographers. and in many other things
Stars: ✭ 477 (+2881.25%)
Mutual labels:  ghost, ghost-blog
Skywalker
A material design theme for ghost blog 🙈🌈🍇
Stars: ✭ 80 (+400%)
Mutual labels:  ghost, ghost-blog
Ghost On Github Pages
Ghost on Github Pages. Build and deploy Ghost for free in a few minutes.
Stars: ✭ 421 (+2531.25%)
Mutual labels:  ghost, ghost-blog
Ghost Azure
Production ready Ghost for Azure 👻
Stars: ✭ 103 (+543.75%)
Mutual labels:  ghost, ghost-blog
biron-ghost-theme
Biron Free Ghost Theme
Stars: ✭ 43 (+168.75%)
Mutual labels:  ghost, ghost-blog
Caffeine Theme
A minimalist, Material Design inspired Ghost Theme for optimal desktop and mobile experiences
Stars: ✭ 300 (+1775%)
Mutual labels:  ghost, ghost-blog
Mnml Ghost Theme
A minimal, responsive, fast ghost blog theme with great typography. Comes with paid membership support, Disqus comments, syntax highlighting, and KaTeX for mathematics, and more.
Stars: ✭ 235 (+1368.75%)
Mutual labels:  ghost, ghost-blog
mention-ghost-theme
Mention theme for Ghost blogging platform, built by https://vanila.io
Stars: ✭ 69 (+331.25%)
Mutual labels:  ghost, ghost-blog

docker-ghost

Docker golden image (gold/ghost) for Ghost.

Most interesting version tags

  • 0.11 - latest of 0.11

  • 0.11.12

  • 0.11.8

  • 0.11.7

Experimental branch

  • alpine - not recomendet for production now.

Why yet another image for Ghost?

Ghost environments suggest that it's better to use production

The official container for Ghost is fine for running in development mode, but it has the wrong permissions for running in production.

Also backup script is backed in. Switc from dev to production environment is easy. Beware in default config both modes operate on same database /content/data/ghost.db

Quickstart

docker run --name some-ghost -p 8080:2368 -d gold/ghost

This will start Ghost in development mode and whire to the port 80 of the container.

Then, access it via http://localhost:8080 or http://host-ip:8080 in a browser.

Running in production

The official Ghost image places the blog content in /var/lib/ghost and exports it as a VOLUME. This allows two main modes of operation:

Content on host filesystem

In this mode, the Ghost blog content lives on the filesystem of the host with the UID:GID of 1000:1000. If this is acceptable, create a directory somewhere, and use the -v Docker command line option to mount it:

sudo mkdir -p /var/lib/ghost
sudo chown 1000:1000 /var/lib/ghost
docker run --name some-ghost --env-file /etc/default/ghost -p 80:2368 -v /var/lib/ghost:/var/lib/ghost -d gold/ghost npm start --production

This is very convinient, because you can tweak your configuration directly in host's /var/lib/ghost/confg.js.

Content in a data volume

This is the preferred mechanism to store the blog data. Please see the Docker documentation for backup, restore, and migration strategies.

docker create -v /var/lib/ghost --name some-ghost-content busybox
docker run --name some-ghost --env-file /etc/default/ghost -p 80:2368 --volumes-from some-ghost-content -d gold/ghost npm start --production

You should now be able to access this instance as http://www.example.com in a browser.

Configuration via environment variables

Epecially in case you run the content in a volume it's good to have a posibillity to injet some config form outide.

There are environment variables that can be used:

  • GHOST_URL: the URL of your blog (e.g., http://www.example.com)
  • MAIL_FROM: the email of the blog installation (e.g., '"Webmaster" <[email protected]>')
  • MAIL_HOST: which host to send email to (e.g., mail.example.com)
  • PROD_FORCE_ADMIN_SSL: Relevant for prodction mode only. Tel's Ghost to force use SSL for admin pages (default: true)
  • MAIL_PORT: sets a port for secure mail connection
  • MAIL_SSL : set "true" or "false"
  • MAIL_USERNAME : The username for the mail server
  • MAIL_PASSWORD : The password for the username above

These can either be set on the Docker command line directly, or stored in a file and passed on the Docker command line:

docker run --name some-ghost --env-file /etc/default/ghost -p 8080:2368 -d gold/ghost

Here an example of ENV variables file:

# Ghost environment example
# Place in /etc/default/ghost

GHOST_URL=http://www.example.com
MAIL_FROM='"Webmaster" <[email protected]>'
MAIL_HOST=mail.example.com
PROD_FORCE_ADMIN_SSL=true
MAIL_SSL=true
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=hopefullyasecurepassword

Behind a reverse proxy

Of course, you should really be running Ghost behind a reverse proxy, and set things up to auto restart. For that, a reasonable container would be:

docker create --name some-ghost -h ghost.example.com --env-file /etc/default/ghost -p 127.0.0.1:2368:2368 --volumes-from some-ghost-content --restart=on-failure:10 gold/ghost npm start --production
docker run some-ghost

Backup

Backup is working for host based or volume based data (see below)

docker run --rm --volumes-from some-ghost -v $(pwd)/backups:/backups gold/ghost /backup.sh

Backups ghost to current directory.

Restoring Backup

Attention: Restore script for volume based data keeping is not provied yet. Make sure you know what to do.

For the host based solution just extract backup file content to volume location on host. Please contact me if you have good ideas how to improve things here.

Example docker-comose.yaml

ghost:
  image: gold/ghost:0.7.9
  command: npm start --production
  restart: always  
  ports: 
   - "2368:2368"
  volumes:
   - /var/containerdata/ghost/blog/:/var/lib/ghost
  environment:
   - GHOST_URL=http://example.com
   - PROD_FORCE_ADMIN_SSL=true
   - MAIL_FROM='"Webmaster" <[email protected]>'
   - MAIL_HOST=mail.example.com
   - MAIL_SSL=true
   - MAIL_PORT=465
   - [email protected]
   - MAIL_PASSWORD=hopefullyasecurepassword

Even if env varibales are provided, config.js can b still found and tweaked in /var/containerdata/ghost/blog/ on the host.

More information

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].