Skip to content

shivansh-gohem/nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Node.js in Docker on AWS (Terraform)

This project deploys a Dockerized Node.js Express app onto a single EC2 instance using Terraform.

  • Uses the default VPC (simple & low-friction)
  • Installs Docker via user data
  • Builds the Docker image on the instance and runs it on port 80
  • Allocates an Elastic IP and prints the URL as an output

Prerequisites

  • AWS account and credentials configured (aws configure)
  • Terraform >= 1.6
  • Default VPC present in the chosen region (it exists in most accounts; you can also adapt to a custom VPC)

Quick start

cd terraform
terraform init
terraform apply

Outputs include public_ip and url. Open the URL to see the

paste the public ip to your browser and then

// connect the instance to gitbash and then in gitbash

do sudo-i cd /opt/app/ docker-compose up -d

-d because we dont want logs

And now our node js app is ready

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published