This is a simple Ghost blog setup wrapped up in Docker containers for easy development and deployment. Here, the default SQLite database is used as it seems to be a good fit for blogging needs. You are free to change it to something more robust like MySQL, thanks to Docker it is pretty easy to do. The content backup is carried out periodically by cron. While in production, the blog is served over HTTPS, free SSL/TLS certificates are fetched and renewed from the Let's Encrypt certificate authority automatically. This project is heavily inspired by this blog post and is being feasible thanks to these awesome projects: nginx-proxy, docker-gen, and letsencrypt-nginx-proxy-companion.
-
A modern GNU/Linux distribution. This setup was tested successfully with Ubuntu 16.04 and 18.04 LTS.
-
A fully registered domain name and a DNS record pointing to your server's public IP address.
You will have to install Docker and Docker Compose by following instructions from the official websites. For the production deployment, I would highly recommend to use Docker Machine. Once you have Docker installed, you are good to go.
In development, the following command executed from the project's root directory will bring the blog up and running:
$ docker-compose upThe blog will be running in development mode on port 2368.
First, spin up a remote server and apply firewall settings using bin/firewall.sh script, if needed. Don't forget to update the DOMAIN_NAME variable in .env file with the actual domain name. Then, create a remote machine using Docker Machine on the development host and connect the running shell to the new machine just created. Finally, execute the following command:
$ docker-compose -f docker-compose.yml -f docker-compose.production.yml up -dThe cron container defined in docker-compose.production.yml file is responsible for periodical backup of data stored in a shared data volume. The backup is scheduled by cron to run every @midnight and @weekly.
