Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ghost host instance
MyGhostHostInstance:
Type: AWS::EC2::Instance
Metadata:
Comment: Install docker, ghost, traefik, commento
AWS::CloudFormation::Init:
config:
commands:
"01_copy_configs":
command: "sudo aws s3 cp s3://{MY-BUCKET-NAME}/blog/config/ /data/traefik/ --recursive"
"02_lets_encrypt_cert_store":
command: "sudo touch /data/traefik/acme.json"
"03_change_config_permissions":
command: "sudo chmod 600 /data/traefik/*.*"
"04_update_packages":
command: "sudo yum update -y"
"05_install_docker":
command: "yes | sudo amazon-linux-extras install docker"
"06_start_docker":
command: "sudo service docker start"
"07_add_EC2_user_to_docker_group":
command: "sudo usermod -a -G docker ec2-user"
"08_install_Git":
command: "sudo yum install -y git"
"09_download_dockercompose":
command: "curl -L https://github.com/docker/compose/releases/download/1.29.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose"
"10_make_dockercompose_executable":
command: "chmod +x /usr/local/bin/docker-compose"
"11_create_a_symlink_to_dockercompose":
command: "sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose"
"12_create_external_network":
command: "docker network create external_network"
"13_create_internal_network":
command: "docker network create internal_network"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment