This project demonstrates a complete end-to-end DevOps workflow:
- Created a simple Node.js application
- Containerized the application using Docker
- Built a Docker image
- Pushed the image to DockerHub
- Launched an AWS EC2 instance
- Pulled the Docker image inside EC2
- Ran the container using port mapping
The application is successfully deployed and accessible via the EC2 public IP.
- Node.js
- Docker
- DockerHub
- AWS EC2
- Linux
Example server.js:
const http = require('http');
http.createServer((req, res) => {
res.write("Hello from Node App!");
res.end();
}).listen(8080);
FROM node:18
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 8080
CMD ["node", "server.js"]
docker build -t Ismaildcode/nodeapp:latest .
docker login
docker push Ismaildcode/nodeapphosting:latest
Created EC2 instance from AWS Console
Connected using SSH
Installed Docker
Opened port 8080 in Security Group
docker pull Ismaildcode/nodeapphosting:latest
docker run -d -p 8000:8080 Ismaildcode/nodeapphosting:latest
http://EC2_PUBLIC_IP:8000
Local Machine
│
▼
Node.js App Created
│
▼
Dockerfile Written
│
▼
Docker Image Built
│
▼
Image Pushed to DockerHub
│
▼
AWS EC2 Launched
│
▼
Image Pulled on EC2
│
▼
Container Run with Port Mapping
│
▼
Application Live on Public IP
