Skip to content

BenjaminBurton/terraform-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Terraform NGINX Install

GitHub milestones GitHub watchers

👋 👋 👋 👋 👋

Documentation

My Personal Documentation

Terraform NGINX webserver setup

Steps Involved:

  • ✅ Install using homebrew
  • ✅ Update Homebrew
  • ✅ Upgrade Homebrew to run the latest version of Terraform
  • ✅ Verify the installation
  • ✅ Enable tab completion
  • ✅ Install the autocomplete package
  • ✅ Download Docker Desktop for Mac
  • ✅ Start Docker Desktop
  • ✅ Create Directory for files
  • ✅ Change Directory (cd) into the directory
  • ✅ create main.tf file
  • ✅ nano into the file
  • ✅ Place configuration code inside file
  • ✅ Initialize the project
  • ✅ Provision the NGINX server container with apply
  • ✅ Confirm with yes
  • ✅ Verify NGINX container by visiting localhost:8000 or run Docker ps in terminal
  • ✅ to stop and destroy the container run terraform destroy in terminal
  • ✅ These are the steps to provision and destroy a NGINX webserver with Terraform

Initial Terraform Configuration file inside the main.tf file

terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 3.0.1"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name         = "nginx"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.image_id
  name  = "tutorial"

  ports {
    internal = 80
    external = 8000
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages