1.6 KiB
1.6 KiB
Checklist for New Staging Instances
-
Build and tag the Docker images:
docker-compose -f docker-compose.yml -f docker-compose.build.yml build -
Create the instance from the template
-
Assign a public Elastic IP address
-
Update Route53 with the new IP address for
pacosako-staging.jessemcdonald.info -
Create the DB volume from a snapshot
-
Attach the DB volume to the instance
-
Clear out old SSH host key information
ssh-keygen -f "$HOME/.ssh/known_hosts" -R "pacosako-staging.jessemcdonald.info" ssh-keygen -f "$HOME/.ssh/known_hosts" -R "1.2.3.4" -
Run the scripts:
./scripts/setup_instance.sh ec2-user@pacosako-staging.jessemcdonald.info ./scripts/copy_images.sh ec2-user@pacosako-staging.jessemcdonald.info ./scripts/copy_compose.sh ec2-user@pacosako-staging.jessemcdonald.info -
Start the containers:
ssh ec2-user@pacosako-staging.jessemcdonald.info \ docker-compose \ -f paco_sako_docker/docker-compose.yml \ -f paco_sako_docker/docker-compose.staging.yml \ up -d -
After a few seconds, restart Apache2 to complete
mod_mdsetup:ssh ec2-user@pacosako-staging.jessemcdonald.info \ docker exec paco_sako_docker_httpd_1 \ /usr/local/apache2/bin/apachectl -k graceful
Instructions for Production Instances
The process for creating a production instance is similar, with the following changes:
- Replace
pacosako-stagingwithpacosako - Use
docker-compose.prod.ymlinstead ofdocker-compose.staging.yml - Create Cloudwatch alarms to avoid runaway billing