Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
.github
.gradle
.idea
build
build/*
!build/libs
build/libs/*
!build/libs/*.jar
out
*.iml
*.iws
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle

- name: Grant Gradle permission
run: chmod +x ./gradlew

- name: Build application jar
run: ./gradlew --no-daemon clean bootJar -x test

- name: Build Docker image
run: docker build -t jobdri-api:${{ github.sha }} .
13 changes: 13 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle

- name: Grant Gradle permission
run: chmod +x ./gradlew

- name: Build application jar
run: ./gradlew --no-daemon clean bootJar -x test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
13 changes: 1 addition & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
FROM eclipse-temurin:21-jdk-alpine AS builder

WORKDIR /workspace

COPY gradlew settings.gradle build.gradle ./
COPY gradle ./gradle
RUN chmod +x gradlew

COPY src ./src
RUN ./gradlew --no-daemon clean bootJar -x test

FROM eclipse-temurin:21-jre-alpine

WORKDIR /app

RUN addgroup -S jobdri && adduser -S jobdri -G jobdri

COPY --from=builder /workspace/build/libs/*.jar app.jar
COPY build/libs/*.jar app.jar

USER jobdri

Expand Down
Loading