From 58c641baeceb7378b065434ed71b5de87fdd82e8 Mon Sep 17 00:00:00 2001 From: mkarthikeyanmuthu-alt Date: Mon, 5 Jan 2026 12:14:59 +0530 Subject: [PATCH 1/4] Update pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 823a73d..ec19214 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ SpringBootMavenExample SpringBootMavenExample SpringBootMavenExample - war + jar org.springframework.boot spring-boot-starter-parent @@ -41,4 +41,4 @@ - \ No newline at end of file + From f8a8ec45eb4b8de91f90e47f0434796549496340 Mon Sep 17 00:00:00 2001 From: mkarthikeyanmuthu-alt Date: Mon, 5 Jan 2026 12:17:06 +0530 Subject: [PATCH 2/4] Create Dockerfile --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c701632 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use official OpenJDK 17 image as base image + +FROM maven:3.9.9-eclipse-temurin-17-alpine AS build + +# Set working directory + +WORKDIR /app + +# Copy the jar built by Maven/Gradle + +COPY target/*.jar app.jar + +# Expose port (adjust if needed) + +EXPOSE 8080 + +# Run the application + +ENTRYPOINT ["java", "-jar", "app.jar"] + From 1019f86439d5ece467a21a50b9a6c7ac3ef184bc Mon Sep 17 00:00:00 2001 From: mkarthikeyanmuthu-alt Date: Mon, 5 Jan 2026 12:17:44 +0530 Subject: [PATCH 3/4] Create main.yml --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..02714a7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: Build Docker Image + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: '17' + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: karthikn0055/builddockerimage:latest From e835851bde9c6de5184ffd1b0ef542237981ce86 Mon Sep 17 00:00:00 2001 From: mkarthikeyanmuthu-alt Date: Mon, 5 Jan 2026 12:22:42 +0530 Subject: [PATCH 4/4] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02714a7..2402112 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,4 +32,4 @@ jobs: with: context: . push: true - tags: karthikn0055/builddockerimage:latest + tags: karthikn5051/builddockerimage:latest