Skip to content

NuTechAcademy-Admin/devopsloft

 
 

Repository files navigation

Release

drawing

Detailed prerequisites and instructions for spinning DEV/STAGE/PROD environments

DEV environment

Prerequisites
  • Install Docker (version 19.03.xx or higher)
  • Install Docker Compose (version 1.25.5 or higher)
  • AWS account
  • AWS Profile
  • Create an envfile '.env.dev' from the example '.env.dev.example'
  • Chrome - Allows requests to localhost over HTTPS even when an invalid certificate is presented. `chrome://flags/#allow-insecure-localhost`
Spin DEV environment Execute the following commands:
  1. make up
  2. Browse: https://localhost:8443
Teardown DEV environment Execute the following commands:
  1. ./build/build.sh dev
  2. source .env.dev
  3. docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ${NAMESPACE}/spinner:latest ./spin-docker.py --action destroy
  4. docker image prune -af
  5. docker volume prune -f

STAGE environment

Prerequisites
  • Dockerhub account
  • AWS account
  • AWS Profile
  • Terraform
  • Docker
  • Docker Compose
  • AWS ~/.aws or %UserProfile%\.aws folder
  • subnet ID
  • Security Group with inbound ports for SSH (22), HTTP (80), HTTPS (443), and 8200
  • AWS S3 Bucket
  • Create an envfile '.env.stage' from the example '.env.stage.example'
Spin STAGE environment

Execute the following:

  1. ./build/build.sh stage
  2. source .env.stage
  3. terraform -chdir=deploy init
  4. terraform -chdir=deploy apply --var-file=aws-stage.tfvars
  5. docker run --rm -v $HOME/.aws:/root/.aws -v /var/run/docker.sock:/var/run/docker.sock ${NAMESPACE}/spinner:latest ./spin-docker.py --environment $ENVIRONMENT
  6. Locate the EC2 instance Public DNS: AWS Consule->EC2->Insance->Public DNS (IPv4)
  7. Browse
Teardown STAGE environment

Execute the following:

  1. ./build/build.sh stage
  2. docker run --rm -v ~/.aws:/root/.aws -v /var/run/docker.sock:/var/run/docker.sock ${NAMESPACE}/spinner:latest ./spin-docker.py --environment $ENVIRONMENT --action destroy
  3. docker image prune -af

PROD environment

Prerequisites
  • Dockerhub account
  • AWS account
  • AWS Profile
  • AWS ~/.aws or %UserProfile%\.aws folder
  • keypair
  • subnet ID
  • Security Group with inbound ports for SSH (22), HTTP (80), HTTPS (443), and 8200
  • AWS S3 Bucket
  • Elastic IP Address (EIP)
  • Create an envfile '.env.prod' from the example '.env.prod.example'
Teardown PROD environment

Execute the following:

  1. ./build/build.sh prod
  2. source .env.prod
  3. docker run --rm -v ~/.aws:/root/.aws -v /var/run/docker.sock:/var/run/docker.sock ${NAMESPACE}/spinner:latest ./spin-docker.py --environment $ENVIRONMENT --action destroy
  4. docker image prune -af
Spin PROD environment

Execute the following:

  1. ./build/build.sh prod
  2. terraform -chdir=deploy init
  3. terraform apply -chdir=deploy --var-file=aws-prod.tfvars
  4. docker run --rm -v $HOME/.aws:/root/.aws -v /var/run/docker.sock:/var/run/docker.sock ${NAMESPACE}/spinner:latest ./spin-docker.py --environment $ENVIRONMENT
  5. Browse www.devopsloft.org

About

DevOps Loft community website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 49.5%
  • HTML 37.4%
  • HCL 3.7%
  • CSS 3.7%
  • Dockerfile 3.0%
  • Jinja 1.0%
  • Other 1.7%