From 6a54d5fdf0bf32d4f4e912546c2a87c6c1fd8b39 Mon Sep 17 00:00:00 2001 From: Aslesha Borkar Date: Wed, 19 Nov 2025 22:34:28 +0530 Subject: [PATCH 1/5] Create Dockerfile for Apache web server setup --- Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8c36434e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Base image +FROM ubuntu:20.04 + +# Set non-interactive for apt +ENV DEBIAN_FRONTEND=noninteractive + +# Update system and install Apache +RUN apt-get update -y && \ + apt-get install -y apache2 && \ + apt-get clean + +# Create working directory +WORKDIR /var/www/html + +# Copy website code into the container +COPY . /var/www/html + +# Change Apache to listen on port 82 instead of 80 +RUN sed -i 's/Listen 80/Listen 82/' /etc/apache2/ports.conf && \ + sed -i 's///' /etc/apache2/sites-available/000-default.conf + +# Expose port 82 for publishing website +EXPOSE 82 + +# Start Apache in foreground (required for Docker) +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] From f3a9fdd48506a5408f0c070e7b57afc68fb80f5a Mon Sep 17 00:00:00 2001 From: Aslesha Borkar Date: Wed, 19 Nov 2025 22:45:47 +0530 Subject: [PATCH 2/5] Add docker-compose configuration for web service --- docker-compose.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..4c14b43a7 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +services: + web: + image: aslesha18/website + container_name: website-container + ports: + - "82:82" + restart: always From 7f26f081025042c75a483f208264a385a9cdd126 Mon Sep 17 00:00:00 2001 From: Aslesha Borkar Date: Thu, 20 Nov 2025 01:06:24 +0530 Subject: [PATCH 3/5] Add Jenkinsfile for CI/CD pipeline setup This Jenkinsfile defines a CI/CD pipeline that clones a repository, builds a Docker image, and deploys a container. --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..f02444db3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +pipeline { + agent {label "ubuntu"} + + stages { + stage("Clone Code"){ + steps { + echo "Cloning repository" + git url: "https://github.com/AsleshaBorkar/website.git", branch:"patch-1" + echo "code cloning is successful" + } + } + stage("Build Docker Image"){ + steps { + echo "Building Docker image" + sh "docker build -t website:latest ." + } + } + + stage("Deploy Container"){ + steps { + echo "Deploying container" + sh " docker compose up -d --build" + echo "Deployment is done!" + } + } + } +} + From 453fe5c22af050f186f8d660487dc212e75ae380 Mon Sep 17 00:00:00 2001 From: Aslesha Borkar Date: Thu, 20 Nov 2025 01:09:18 +0530 Subject: [PATCH 4/5] Update greeting message in index.html --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 19c25caa0..5b08d2e30 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ Intellipaat -

Hello world!

+

Hey There, I'm Aslesha Borkar!

+ From a0eb0bb0f734781674638e2ec888c3b7f1b9745c Mon Sep 17 00:00:00 2001 From: Aslesha Borkar Date: Thu, 20 Nov 2025 01:24:26 +0530 Subject: [PATCH 5/5] Update deployment command to include shutdown --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f02444db3..d86294cdf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage("Deploy Container"){ steps { echo "Deploying container" - sh " docker compose up -d --build" + sh "docker compose down && docker compose up -d --build" echo "Deployment is done!" } }