8000 GitHub - ObsidianMaximus/terraform_basics
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ObsidianMaximus/terraform_basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Objective

Provision a local Docker container running Nginx using Terraform.

Tools

  • Terraform
  • Docker

Deliverables

  • main.tf (Terraform configuration file)
  • Execution logs

Usage

1. Prerequisites

  • Install Docker
  • Install Terraform

2. How to Use

  1. Clone or copy this repository/project directory.

  2. Update the host path in main.tf if needed:

    • The current config mounts the host directory $HOME/T4/nginx/ to the container's /usr/share/nginx/.
    • Make sure $HOME/T4/nginx/ exists on your machine.
  3. Initialize Terraform:

    terraform init
  4. Preview the execution plan:

    terraform plan
  5. Apply the configuration to create the container:

    terraform apply
    • Type yes to confirm.
  6. Check container status:

    docker ps
  7. View Terraform-managed resources:

    terraform state list
  8. Destroy all resources when finished:

    terraform destroy

Notes

  • Make sure Docker is running before applying the configuration.
  • Review the m 5051 ain.tf file and edit as needed for your environment.
  • All state files and sensitive info should be added to .gitignore.

.gitignore (Terraform-specific)

.terraform/
terraform.tfstate.*

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0