Code Monkey home page Code Monkey logo

docker-ghost's Introduction

docker-ghost

Build Status Coverage Status Gitter

Want to find out more about Ghost, the professional open-source publishing platform?

This repository builds a Docker container image for the Ghost publishing platform, designed to be used on a variety of cloud platforms and environments, with as many storage and scheduling options as we can reasonably manage and maintain.

More details

First of all, if you're interested in trying Ghost, and you are at all unsure about how to get going, or you have no experience building custom solutions on platforms like AWS, Kubernetes, and Google Cloud: this project is not for you.

Seriously, if you're just looking for a cheap way to deploy a publishing platform, I strongly encourage you to pay the money and get a Ghost(Pro) subsrciption - the hosted service is run by the Ghost Foundation, and all the money they make goes straight back into the foundation to pay for the infrastructure and the salaries of the core developers that make Ghost amazing.

That having been said, if you have a need or desire to run your own self-hosted Ghost server, this project is a great way to get that going.

The docker images built by this project are designed to run in a variety of cloud environments, at a minimum including:

  • Heroku
  • Google Cloud (GKE or GCE)
  • AWS (EC2, EKS)
  • Digital Ocean (Docker or Kubernetes)
  • and probably many more; in theory, any Kubernetes based platform should work.

Database support and documentation is included for:

  • Amazon RDS
  • Google Cloud SQL
  • Heroku JAWSDB

Mail integration support and documentation is included for:

  • Mailgun

Adapters for storage and scheduling are included for:

  • Amazon S3 (storage)
  • Google Cloud Storage (storage)

Support for custom scheduling (e.g. Heroku scheduler) is currently in the works.

Looking into Digital Ocean block storage as well.

Getting Started

You can deploy the Docker image directly from hub.docker.org.

Setup of a Ghost server can be quite involved; be sure to check the documentation for more guidance.

Environment Variables

Here is a quick summary of the environment variables to pass through to the container. Note that this does not include the low level Ghost environment variables, which are typically lower case (for example 'database__connection__filename').

Variable Name Ghost Config Node (if any) Description
PORT server.port Defines the port to expose. Automatically defined by Heroku. GHOST_PORT overrides this
MAILGUN_SMTP_LOGIN mail.options.auth.user Mailgun user. Automatically defined by Heroku's Mailgun app.
MAILGUN_SMTP_PASSWORD mail.options.auth.pass Mailgun password. Automatically defined by Heroku's Mailgun app.
JAWSDB_URL database.connection.* Connection URL for database. Automatically defined by Heroku's JAWSDB app.
MYSQL_DATABASE_URL database.connection.* Alternative connection URL for database.
CLEARDB_DATABASE_URL database.connection.* Alternative connection URL for database.
GHOST_PORT server.port The port to listen for connections on.
GHOST_ADMIN_URL admin.url The hostname and path of the admin site.
GHOST_PUBLIC_URL url The public URL used to access the blog site.
GHOST_MYSQL_DATABASE database.connection.database The name of the database to be used, if no URL specified.
GHOST_MYSQL_HOST database.connection.host The hostname of the database to be used, if no URL specified.
GHOST_MYSQL_PORT database.connection.port The TCP port of the database to be used, if no URL specified.
GHOST_MYSQL_USER database.connection.user The username of the database to be used, if no URL specified.
GHOST_MYSQL_PASSWORD database.connection.password The password of the database to be used, if no URL specified.
GHOST_MYSQL_CA database.connection.ssl.ca The contents of the CA for the server. If set to 'Amazon RDS', ignore the cert and key fields and use the special RDS profile.
GHOST_MYSQL_CERT database.connection.ssl.cert The contents of the public SSL certificate for this client.
GHOST_MYSQL_KEY database.connection.ssl.key The contents of the private SSL key for this client.
GHOST_MAIL_FROM mail.from The email 'From' address, in format '"Some Name" [email protected]'
GHOST_MAIL_USER mail.options.auth.user The username of the SMTP account to email from
GHOST_MAIL_PASSWORD mail.options.auth.pass The password of the SMTP account to email from
GHOST_LOG_LEVEL logging.level The logging level. Defaults to info, can be set to error or debug for less or more logging respectively.
GHOST_STORAGE_ADAPTER storage.active The active storage adapter
GHOST_STORAGE_GCLOUD_KEY storage.gcloud.key The contents of the Google service account credential JSON file.
GHOST_STORAGE_GCLOUD_PROJECT_ID storage.gcloud.projectId The Project ID in Google Storage for this bucket.
GHOST_STORAGE_GCLOUD_BUCKET storage.gcloud.bucket The name of the Google Storage bucket. May often be the domain name of the site.
GHOST_STORAGE_GCLOUD_MAX_AGE storage.gcloud.maxAge The maximum age of objects in Storage before they need to be replaced.
GHOST_STORAGE_GCLOUD_ASSET_DOMAIN storage.gcloud.assetDomain The asset domain to access the storage bucket.
GHOST_STORAGE_S3_ACCESS_KEY_ID storage.s3.accessKeyId The AWS S3 access key.
GHOST_STORAGE_S3_SECRET_ACCESS_KEY storage.s3.secretAccessKey The AWS S3 secret access key.
GHOST_STORAGE_S3_BUCKET storage.s3.bucket The name of the S3 bucket to use for static files.
GHOST_STORAGE_S3_REGION storage.s3.region The name of the AWS region where the S3 bucket is hosted.
GHOST_STORAGE_S3_ASSET_HOST storage.s3.assetHost The hostname to access assets in this bucket via a public URL.
GHOST_STORAGE_S3_BUCKET_SUBDIR storage.s3.pathPrefix The base subdirectory to access the assets in this bucket under.

Continuous Integration

Continuous Integration of the master branch is done via Travis-CI, with Docker images automatically deployed to Docker Hub whenever new code is commited to the master branch.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the processes for contributing to the project.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Dan Sloan - primary maintainer - website (yes, it runs on Ghost using this project)

See also the list of contributors who have participated in this project.

License

This project is licensed under the ISC License - see the LICENSE file for details

Acknowledgments

  • Ghost is amazing, and the Ghost Foundation is fantastic in the relatively unique model of non-profit open source development they've set up.

docker-ghost's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

cowpewter

docker-ghost's Issues

Add support for themes to be stored in object storage

Currently, themes are loaded into the Docker image - uploading themes will fail because we have no persistent storage for them.

It'd be really cool if we could upload themes, have them stored in object storage (e.g. S3 etc), and lazy-load the themes from storage when they are activated.

Write a deployment guide for AWS

Write a deployment guide for AWS with EC2 or EKS (Amazon's Kubernetes solution) or something, and with S3 storage.

Add Cloudfront CDN doco when/if supported.

Quick question on the Docker Image choice

Hi @LucidDan ! I really like how you installed Ghost in this Docker image. Makes it really easy to use the storage plugins.

A quick question just out of curiosity: why did you take the route of installing Ghost from scratch instead of adding the plugins to the official Ghost image?

Thanks.

Write a deployment guide for Heroku

Write a deployment guide for deploying to Heroku with a MySQL addon.
In general this will also require object storage from somewhere - possibly a Heroku addon like Cloudcube, HDrive, Storj, etc?

May want to look at Fastly or something for CDN as well. Otherwise Cloudflare.

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.