With this repo you will be able to use a docker-compose to spin up your Ghost blog in no time!.
- NGINX proxy to manage your connections.
- Obtain and automatically renew ssl certificates with Let´s Encrypt.
- MySql database.
- Volumes for each container mapped to host.
- Mailgun support for transactional emails.
- Configuration centralized in a single file:
.env.
In order to use this compose file (docker-compose.yml) you must have:
- docker (https://docs.docker.com/engine/installation/)
- docker-compose (https://docs.docker.com/compose/install/)
-
Clone this repository:
-
Make a copy of the
.env.sample
and rename it to.env
and update this file with your info and preferences. -
Run the start script
./start.sh
Your Ghost blog is ready to go!
You don´t need to open port
443
in your container, the certificate validation is managed by the web proxy.
Please note that when running a new container to generate certificates with LetsEncrypt (
-e LETSENCRYPT_HOST=your.domain.com
), it may take a few minutes depending on multiples circumstances. Also note that theLETSENCRYPT_TEST=${LETSENCRYPT_TEST:-true}
is set to true in the in the.env
. Change to false when finished debugging and the blog is ready for real traffic. This is to avoid exceeding the certificate rate limit for your domain. More info here.
- To add specific NGINX configurations, such as redirects etc... create a
.conf
file and add it to conf.d directory, while setting theUSE_NGINX_CONF_FILES
to true in the.env.
file. - To use Cloudflare, read and uncomment the necessary lines in the
/conf.d/realip.conf
file. - To use Mailgun, set your credentials in the
.env
file and uncomment the respective lines in the compose file.
All credit goes to: