Configuration details:
- EC2 instance name: todaysphere-app
- Docker node.js app image name : todaysphere_app
- Docker node.js app container name: todaysphereapp
- App URL format - http://EC2_INSTANCE_PUBLIC_IP_ADDRESS:3000
Deployment link - https://todaysphere-app.onrender.com
Table of Contents
About The Project
Description
TodaySphere Node.js App which has completely automated deployment using Jenkins, AWS EC2, Docker and GitHub CI/CD. This app accepts location as an input from the user and based on that it shows the current weather, news for that location/region, an activity of the day which the user can perform and NASA's Astronomy Picture of the Day. A one-stop solution to start a good day! 😃
For the Devops part of this project, I created an AWS EC2 instance, installed Jenkins on the server, then integrated Jenkins with this GitHub repository containing Node.js app code. Next, using Docker, I dockerized the Node.js app and automated this process on Jenkins. Finally automated the whole process using GitHub Webhooks.
App Name: Today + Atmosphere(around you) - TodaySphere 😉
Technologies used
- Node.js
- AWS EC2
- Jenkins
- Docker
- GitHub Webhooks (for CI/CD)
APIs used
- WeatherStack
- Mapbox
- NewsAPI.org
- NASA Open APIs
- Bored API
Screenshots
Getting Started
To get started with the project, follow these steps:
Prerequisites
- AWS account
- GitHub account
Commands used
Note:
-
Make sure to enable port 8080 inbound traffic while creating the EC2 instance
-
(with default settings) Login as "ubuntu" using putty with the .ppk file
-
Inside the EC2 instance (choose OS as Ubuntu)
- Installing Java inside EC2 instance
sudo apt install openjdk-11-jre
- Installing Jenkins on EC2 instance
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key |sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpgsudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo systemctl start jenkins.service
sudo systemctl status jenkins
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- After setting up Jenkins, use the following commands to integrate it with GitHub
- Running the Node.js app on EC2 instance
cd /var/lib/jenkins/workspace/todaysphere-app- Installing Docker and Containerizing the Node.js app
sudo apt install docker.io
sudo chmod 777 /var/run/docker.sock
sudo docker build . -t todaysphere_appsudo docker run -d --name todaysphereapp -p 3000:3000 todaysphere_app:latest
- Jenkins Build step (execute shell)
docker build . -t todaysphere_appdocker container rm -f todaysphereapp
docker run -d --name todaysphereapp -p 3000:3000 todaysphere_app:latest
- Optional - To open access to ports/firewall modification (incase 8080 port does not open)









