Updated 2020-NOV-26:
This diverts a bit away from the original fork, in order to run with a newer version of Ghost and Caddy 2.
docker-ghost-caddy will set up a Ghost blog behind a Caddy proxy on Docker Compose. Your blog will be secured by an SSL certificate from Let's Encrypt. I forked this repo from Nate Todd's version that can be found here
The principle differences here are that I use the official Ghost docker image instead of Nate's (I trust Ghost to keep that up to date rather than maintaining one here) and I rewrote the Dockerfile for Caddy to use the latest version and fix some other issues I was having when running the original version.
- Clone repository to your server
- In
Caddyfile
changehttps://localhost
andyou@example.com
to your blog's domain and your email (email used for generation of SSL certificate) - In
docker-compose.yml
changehttp://localhost
to your https domain - Also in
docker-compose.yml
, change themail__options__auth__user
andmail__options__auth__pass
parameter values to your Mailgun SMTP credentials as needed to send emails from Ghost, as described here: https://docs.ghost.org/docs/mail-config. If you don't need this, then you may be able to simply delete themail__*
options, though I haven't personally tried this without them. - Ensure your DNS record is pointed at your server. If it is not, Let's Encrypt will not be able to generate your SSL cert and Caddy will fail to start.
- Run
docker-compose build
to build the docker images - Run
docker-compose up
to run everything in the foreground, then press Ctrl-C to exit gracefully
Run docker-compose up -d
to run in detached mode
Run docker-compose stop
to stop
The Ghost service mounts the content
directory where you can access all your blog data. Since we're not using a separate DB container, Ghost defaults to using a SQLite db file, which can easily be backed up. Which you should totally do.