A containerized Node.js REST API project built to practice DevOps fundamentals including Docker, Docker Compose, Nginx reverse proxy, GitHub Actions CI/CD, and Docker Hub image publishing.
- REST API built with Node.js and Express
- Health check endpoint
- Notes endpoint with sample data
- Prometheus metrics endpoint
- Dockerized application
- Docker Compose setup
- Nginx reverse proxy
- GitHub Actions CI/CD pipeline
- Automated Docker image build and push to Docker Hub
- Node.js
- Express.js
- Docker
- Docker Compose
- Nginx
- GitHub Actions
- Docker Hub
- Prometheus Client
devops-notes-api/
│
├── .github/
│ └── workflows/
│ └── ci.yml
│
├── src/
│ └── server.js
│
├── Dockerfile
├── docker-compose.yml
├── nginx.conf
├── .dockerignore
├── package.json
├── package-lock.json
└── README.md| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Returns API running message |
| GET | /health |
Returns server health status |
| GET | /notes |
Returns sample notes |
| GET | /metrics |
Returns Prometheus metrics |
Install dependencies:
npm installStart the server:
npm startOpen:
http://localhost:3000Build Docker image:
docker build -t devops-notes-api .Run container:
docker run -p 3000:3000 devops-notes-apiOpen:
http://localhost:3000Start containers:
docker compose up --buildOpen:
http://localhost:8080Stop containers:
docker compose downThis project uses GitHub Actions to automatically:
- Checkout the code
- Login to Docker Hub
- Build the Docker image
- Push the image to Docker Hub
Docker Hub image:
prakharsinghal7725/devops-notes-api:latestDeveloper Push
↓
GitHub Repository
↓
GitHub Actions
↓
Docker Image Build
↓
Docker Hub
↓
Docker Compose
↓
Nginx Reverse Proxy
↓
Node.js API ContainerBuilt and containerized a Node.js REST API using Docker and Docker Compose, configured Nginx as a reverse proxy, exposed Prometheus metrics, and implemented a GitHub Actions CI/CD pipeline to automatically build and push Docker images to Docker Hub.