https://github.com/trivediayush/terraform_iaac
Terraform to provision a local Docker container running an NGINX
https://github.com/trivediayush/terraform_iaac
docker nginx terraform
Last synced: 5 months ago
JSON representation
Terraform to provision a local Docker container running an NGINX
- Host: GitHub
- URL: https://github.com/trivediayush/terraform_iaac
- Owner: trivediayush
- Created: 2025-04-10T06:52:49.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-10T07:21:44.000Z (about 1 year ago)
- Last Synced: 2025-05-17T00:14:53.614Z (about 1 year ago)
- Topics: docker, nginx, terraform
- Language: HCL
- Homepage:
- Size: 7.21 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🚀 Terraform Task 3: Provision Docker Container
===============================================
📌 Objective
------------
Use Terraform to provision a local Docker container running an NGINX server.
🛠️ Tools Used
--------------
* Terraform
* Docker
📂 Files Included
-----------------
* `main.tf` - Terraform configuration file
📋 Steps to Run
---------------
1. Install Docker and Terraform on your machine
2. Open a terminal and navigate to the project folder
3. Run `terraform init` to initialize Terraform
4. Run `terraform plan` to see the execution plan
5. Run `terraform apply` and type `yes` to confirm
6. Open your browser and go to [http://localhost:8080](http://localhost:8080) to view the NGINX server
7. (Optional) Run `terraform destroy` to remove the container
🌐 Port Mapping
---------------
Container Port `80` is mapped to Host Port `8080`.
📸 Output
---------
* NGINX container pulled and started successfully
* Accessible at `http://localhost:8080`
⚠️ Notes
--------
* The attribute `docker_image.nginx.latest` is deprecated. Use `docker_image.nginx.name` instead.
🖼️ Screenshots

👤 Author
---------
# Ayush Trivedi
---------