Infrastructure-as-code configuration for Ghost on AWS.
This is a playground to test concepts of infrastructure-as-code, in particular low-costs projects that still need a dedicated server, but otherwise have minimal requirements to run.
It uses Packer to create an AWS AMI, Terraform to manage infrastructure and Docker to run Ghost. Backups are stored in S3.
Currently, following manual steps need to be done to deploy and the aim is to simplify them as much as possible:
- Source variables, setup AWS "private" profile and blog keypair
- Run backup script (if instance exists)
- Run packer to create/update AMI
- Run terraform to create/update infra (update AMI)
- Run upload backup script (update public dns - $INSTANCE)
- Run docker-compose on the instance
- add CI
- remove domain specific data (from git too)
- dry run for certs
- blue/green deploys
- non-local tf state
- pass AMI to terraform
- pass ec2 public dns to bash
- pass env vars to instance start scripts
- improve nginx config