A Project report on
“Web Server using Docker“
submitted in partial fulfillment of the Academic requirements for the award of the
degree of
Bachelor of Technology
Submitted by
P. DEEPAK - (22H51A05H7)
SAI VIVEK - (22H51A05J2)
T VINAY KUMAR - (23H51A05J6)
UNDER THE COURSE
DEVOPS LABORATORY
CMR COLLEGE OF ENGINEERING &
TECHNOLOGY
(Autonomous)
(NAAC Accredited with ‘A+’ Grade & NBA Accredited)
(Approved by AICTE, Permanently Affiliated to JNTU Hyderabad)
KANDLAKOYA, MEDCHAL ROAD, HYDERABAD-501401
2023-24
1
CMR COLLEGE OF ENGINEERING & TECHNOLOGY
(AUTONOMUS)
(NAAC Accredited with ‘A+’ Grade & NBA Accredited)
(Approved by AICTE, Permanently Affiliated to JNTU Hyderabad)
KANDLAKOYA, MEDCHAL ROAD, HYDERABAD-501401
2023-24
CERTIFICATE
This is to certify that a Micro Project entitled with “ Web Server using Docker”
is being Submitted By
P. DEEPAK 22H51A05H7
SAI VIVEK 22H51A05J2
T VINAY KUMAR 22H51A05J6
In partial fulfillment of the requirement for completion of the “DEVOPS
LABORATORY ” of III-B.Tech I- Semester is a record of a bonafide work carried out
under guidance and supervision.
Signature of Faculty Signature of HOD
2
ACKNOWLEDGEMENT
We are obliged and grateful to thank, CMRCET, for his cooperation in all respects during
the course.
We would like to thank the Principal of CMRCET, Major.Dr.V.A.Narayana , for his
support in the course of this project work.
We would like to thank the head of CSE department Dr.S.Siva Skandha and our subject
faculty Mr.B.K Chinna Maddileti for his support in the course of this project work.
Finally, we thank all our faculty members and Lab Programmer for their valid support.
We own all our success to our beloved parents, whose vision, love and inspiration has
made us reach out for these glories.
P. DEEPAK 22H51A05H7
SAI VIVEK 22H51A05J2
T VINAY KUMAR 22H51A05J6
3
TABLE OF CONTENTS
SI.No. CONTENTS PAGE.NO
1. Abstract 5
2. Introduction 6
3. Proposed Solution 7
4. Architecture 8
5. Source code 9
6. Results and Discussion 11
7. Conclusion 13
8. Future Enhancement 14
9. Reference 15
4
ABSTRACT
The "Web server using docker " project aims to address the challenges faced by modern software development
teams in managing efficient and error-free builds. The software development lifecycle (SDLC) often involves
repetitive tasks like compiling code, running tests, and deploying applications. These tasks, if performed
manually, can result in inconsistencies, delays, and errors. By automating these processes, this framework
enhances productivity, reliability, and collaboration within teams.
The project utilizes state-of-the-art DevOps tools, including Jenkins for pipeline orchestration, Docker for
environment standardization, and GitHub for version control and collaboration. These tools, integrated
seamlessly, form the backbone of the automation framework. The result is a solution that not only automates
routine tasks but also provides real-time feedback on code quality, enabling developers to focus on
innovation.
Designed with scalability and adaptability in mind, the framework supports projects of varying complexities.
It is particularly valuable for teams working in agile environments where rapid iteration and frequent
deployments are critical. This document outlines the need for automation, the proposed solution, its
architecture, and the results achieved, providing a roadmap for future enhancements to ensure the
framework’s continued relevance in evolving software landscapes.
5
CHAPTER 1
INTRODUCTION
In the ever-evolving field of software development, efficiency and reliability are paramount. As
software applications grow more complex, so do the processes required to build, test, and deploy
them. Traditional methods that rely on manual intervention often lead to slower turnaround times,
inconsistent results, and human errors. These inefficiencies hinder the ability of teams to deliver
high-quality software at the pace demanded by modern businesses.
The "Web Server Using Docker" project seeks to address these challenges by introducing
automation into the SDLC. Automation not only streamlines processes but also ensures that each
step, from code integration to deployment, is executed consistently and without errors. The
framework utilizes tools like Jenkins, a widely used automation server; Docker, which provides
containerized environments; and GitHub, the industry standard for version control and
collaboration. Together, these tools create a robust and efficient pipeline.
The need for this framework stems from the growing adoption of agile and DevOps
methodologies, which emphasize rapid iteration, continuous integration (CI), and continuous
delivery (CD). By implementing this automation framework, teams can reduce manual effort,
accelerate feedback loops, and improve software quality.
This project is designed to be accessible to both novice and experienced developers. Its modular
design allows users to customize pipeline stages to meet specific project needs. Whether the team
is developing small-scale applications or enterprise-grade solutions, this framework provides the
foundation for efficient and reliable software delivery.
6
CHAPTER-2
PROPOSED SOLUTION
The proposed solution is a fully automated build, test, and deployment pipeline, leveraging DevOps
best practices and tools. This pipeline ensures that every code change is systematically processed,
tested, and packaged, minimizing the risk of errors and accelerating the development cycle.
1. Version Control with GitHub
The process begins with developers pushing their code changes to a GitHub repository. GitHub
acts as the central repository, enabling seamless collaboration among team members. Developers
can review pull requests, resolve conflicts, and merge code changes with minimal disruption.
2. Pipeline Orchestration with Jenkins
Jenkins is the heart of the framework, orchestrating the entire CI/CD pipeline. Once a code change
is pushed to GitHub, Jenkins automatically triggers a pipeline. This pipeline consists of multiple
stages, including fetching the code, running unit tests, building the application, and packaging it
into a Docker container. Jenkins' plugin ecosystem provides flexibility, allowing teams to integrate
additional tools for static code analysis, security scanning, or performance testing.
3. Environment Consistency with Docker
Docker ensures that the application runs in the same environment across development, testing, and
production stages. By containerizing the application and its dependencies, Docker eliminates issues
caused by environment discrepancies. Developers can define the container configuration in a
Dockerfile, ensuring consistency across builds.
4. Deployment and Feedback
Once the application is successfully built and tested, it is deployed to a staging or production
7
environment. Developers receive real-time feedback on the success or failure of each pipeline stage,
enabling them to quickly identify and address issues.
The solution’s modular design allows for customization based on the project’s specific requirements.
For instance, teams can add stages for integration testing, performance benchmarking, or
vulnerability assessment. This adaptability ensures that the framework remains relevant across
different projects and development workflows.
8
CHAPTER 3
SYSTEM ARCHITECTURE
The architecture of the "Create a Build Automation Framework" is designed for modularity, scalability,
and efficiency. It integrates core tools like Jenkins, GitHub, and Docker, enabling seamless automation
from code integration to deployment.
1. Source Control (GitHub)
o Purpose: Serves as the central repository for code.
o Functionality: Tracks changes, manages branches, and facilitates collaboration through
pull requests and issue tracking.
2. Continuous Integration and Deployment (Jenkins)
o Purpose: Automates the build, test, and deployment pipeline.
o Functionality: Fetches code from GitHub, triggers unit tests, builds the application, and
orchestrates the pipeline stages. Jenkins pipelines are configured as code, enabling easy
customization and versioning.
3. Containerization (Docker)
o Purpose: Standardizes application environments.
o Functionality: Packages the application and its dependencies into containers, ensuring
consistent behaviour across different environments.
4. Deployment and Monitoring
o Purpose: Ensures that applications are deployed consistently and monitored effectively.
o Functionality: Deploys containerized applications to staging or production environments,
with real-time monitoring for feedback and issue resolution.
9
CHAPTER 4
SOURCE CODE
Docker file:
FROM openjdk:17-jdk-alpine
WORKDIR /usr/src/app
COPY Main.java .
RUN javac Main.java
CMD ["java", "Main"]
import java.util.Scanner;
public class Main {
// Method to display a general greeting message
public static void displayGreeting() {
System.out.println("====================================");
System.out.println("Welcome to the Java Greeting Program!");
System.out.println("====================================\n");
}
// Method to get user's name and greet them personally
public static void greetUser() {
// Creating a scanner object to read input from the console
System.out.println("Hello, DEVOPS ! It's great to meet you.");
// Closing the scanner to avoid resource leaks
}
public static void main(String[] args) {
// Display the general greeting message
displayGreeting();
10
// Greet the user with their name
greetUser();
// Display a farewell message
System.out.println("\nThank you for using the Java Greeting Program. Have a great
day!");
}
}
Node.js Server (app.js):
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello from the Dockerized Web Server!');
});
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
});
Jenkins Pipeline Script (Jenkinsfile):
pipeline {
agent any
stages {
stage('Fetch Code') {
steps {
git branch: 'master', credentialsId: 'your-credentials-id', url:
'https://github.com/your-username/your-repo.git'
11
}
}
stage('Build Web Server') {
steps {
sh 'npm install'
sh 'npm run build' // Replace with your build command if applicable
}
}
stage('Dockerize Web Server') {
steps {
sh 'docker build -t my-web-server .'
}
}
stage('Deploy (Optional)') {
steps {
// Push the Docker image to a registry or deploy to a container platform
}
}
}
}
12
CHAPTER 5
RESULT AND DISCUSSIONS
Figure 5.1
Figure 5.2
13
Figure 5.3
Figure 5.4
14
CHAPTER 6
CONCLUSION
The "Create a Build Automation Framework" project has successfully achieved its
primary objective of streamlining the software development lifecycle (SDLC) by
automating repetitive tasks like building, testing, and deployment. The framework
effectively demonstrates how integrating tools like Jenkins, GitHub, and Docker can
result in a cohesive, reliable, and efficient development process. It caters to the growing
need for agile workflows and DevOps practices by reducing manual errors, standardizing
environments, and accelerating feedback loops. One of the major accomplishments of this
project is its ability to cater to diverse team needs. By designing the framework with
modularity in mind, we ensured that it could support a wide range of projects, from simple
applications to enterprise-grade solutions. The automation of tasks like code integration,
testing, and deployment not only reduces the burden on developers but also enhances
overall productivity. The successful integration of GitHub, Jenkins, and Docker
highlights the synergy of modern DevOps tools. GitHub acts as the backbone for
collaborative development, while Jenkins orchestrates the pipeline and Docker ensures
consistent environments. This combination simplifies complex processes, making the
pipeline robust and easy to manage. In conclusion, the "Create a Build Automation
Framework" project represents a significant step toward modernizing the SDLC. It
empowers teams to deliver high-quality software at a faster pace, meeting the demands of
today’s dynamic business environment. This framework serves as a foundation for
continuous improvement, paving the way for future innovations in build automation.
15
CHAPTER 7
FUTURE ENHANCEMENT
To ensure the "Create a Build Automation Framework" remains relevant and adaptable,
several enhancements can be implemented to address emerging challenges and leverage
advanced technologies.
1. AI and Machine Learning Integration
AI can optimize the framework by predicting build failures, identifying root causes, and
dynamically allocating resources during builds. These improvements can enhance
efficiency and reduce downtime.
2. Kubernetes for Orchestration
Integrating Kubernetes can bring advanced container orchestration capabilities, such as
automatic scaling, rolling updates, and improved management of microservices
architectures.
3. Enhanced Monitoring and Feedback
Incorporating tools like Prometheus and Grafana can provide real-time metrics, detailed
dashboards, and automated alerts for better pipeline performance analysis.
4. Multi-Cloud Deployment Support
Expanding support to multiple cloud platforms, including AWS, Azure, and Google
Cloud, can improve flexibility and resilience, while optimizing costs and ensuring high
availability.
5. Improved User Experience
User-friendly features such as setup wizards, comprehensive documentation, and a
graphical user interface (GUI) can simplify adoption and usage for development teams.
16
6. Expanded Toolchain Integration
Adding tools like SonarQube for code analysis, OWASP ZAP for security testing, and
Apache JMeter for performance testing can enhance the pipeline's capabilities.
7. Compliance and Security Enhancements
Implementing automated compliance checks, data encryption, and role-based access
control can ensure the framework meets stringent security and data privacy standards.
8. Cross-Platform Compatibility
Supporting multiple operating systems, programming languages, and mobile development
pipelines will make the framework more versatile and applicable to various projects.
9. Community and Ecosystem Development
Open-sourcing the framework, hosting educational events, and creating a plugin
marketplace can foster a community-driven ecosystem, encouraging innovation and user
engagement.
10. Emerging Technology Integration
Incorporating serverless architectures, blockchain for secure logging, and edge computing
for IoT pipelines can position the framework at the forefront of modern software
development.
By focusing on these enhancements, the "Create a Build Automation Framework" can
evolve into a robust, scalable, and user-centric solution that meets the dynamic needs of
software development teams.
17
REFERENCES
WEBSITES:
Jenkins Pipeline with Docker
Jenkins
Automating Docker Builds with Jenkins
DevSecOps and Cloud Computing Coaching
Build Automation with Jenkins
GitHub
Using Jenkins for CI/CD Pipelines
GitHub
Docker and Jenkins Integration
18