From 7c020072bd33826703ea58c9a39287774e211945 Mon Sep 17 00:00:00 2001 From: pricelees Date: Thu, 10 Jul 2025 12:19:54 +0900 Subject: [PATCH] feat: add Dockerfile & CI script for building application --- .gitea/workflows/integration.yaml | 30 ++++++++++++++++++++++++++++++ Dockerfile | 10 ++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .gitea/workflows/integration.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/integration.yaml b/.gitea/workflows/integration.yaml new file mode 100644 index 0000000..a936229 --- /dev/null +++ b/.gitea/workflows/integration.yaml @@ -0,0 +1,30 @@ +name: Build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ${{ secrets.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_IMAGE }}:${{ gitea.sha }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9bbe253 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM gradle:8-jdk17 AS builder +WORKDIR /app +COPY . . +RUN gradle bootJar --no-daemon + +FROM amazoncorretto:17 +WORKDIR /app +EXPOSE 8080 +COPY --from=builder /app/build/libs/*.jar app.jar +ENTRYPOINT ["java", "-jar", "app.jar"] \ No newline at end of file