feat: add Dockerfile & CI script for building application

This commit is contained in:
이상진 2025-07-10 12:19:54 +09:00
parent 9aea1a398a
commit 7c020072bd
2 changed files with 40 additions and 0 deletions

View File

@ -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 }}

10
Dockerfile Normal file
View File

@ -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"]