-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Starlight258/feat/dockerizing
[Feat/#1,5,6] 도커 환경 지원 및 H2 DB 파일 기반으로 전환
- Loading branch information
Showing
9 changed files
with
254 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[#issue] type: description | ||
|
||
# Commit Message Convention | ||
# | ||
# - 커밋 메시지는 반드시 영어로 작성합니다. | ||
# - GitHub 이슈 번호를 참조합니다. | ||
# - Description의 첫 글자는 대문자로 시작합니다. | ||
# | ||
# 기본 형식 | ||
# - `[#{issue-number}] <type>: <description>` | ||
# | ||
# 예시 | ||
# - `[#123] feat: Add login functionality` | ||
# | ||
# Commit Types | ||
# | ||
# 🌟 새로운 기능 및 주요 변경 | ||
# - `feat`: 새로운 기능 추가 | ||
# - `!BREAKING CHANGE`: 큰 API 변경 | ||
# | ||
# 🛠️ 버그 수정 및 긴급 조치 | ||
# - `fix`: 버그 수정 | ||
# - `!HOTFIX`: 긴급한 버그 수정 | ||
# | ||
# 🔧 코드 개선 | ||
# - `refactor`: 코드 리팩토링 | ||
# - `style`: 코드 포맷 변경, 세미콜론 누락 등 코드 수정 없는 경우 | ||
# | ||
# 📚 문서 및 주석 | ||
# - `docs`: 문서 수정 | ||
# - `comment`: 주석 추가 및 변경 | ||
# | ||
# 🧪 테스트 | ||
# - `test`: 테스트 코드 추가, 프로덕션 코드 변경 없음 | ||
# | ||
# 🏗️ 구조적 변경 | ||
# - `rename`: 파일/폴더명 수정, 이동 | ||
# - `remove`: 파일 삭제 | ||
# | ||
# 🎨 기타 | ||
# - `chore`: 빌드 업무 수정, 패키지 매니저 변경 등 프로덕션 코드 변경 없는 경우 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# JDK 17을 기반으로 하는 이미지 사용 | ||
FROM openjdk:17-alpine | ||
|
||
# 작업 디렉토리 | ||
WORKDIR /usr/src/app | ||
|
||
# 변수 정의 (빌드 시 사용) | ||
ARG JAR_PATH=./build/libs | ||
|
||
# 빌드한 파일 옮기기 | ||
COPY ${JAR_PATH}/*.jar ${JAR_PATH}/app.jar | ||
|
||
# 환경변수 설정 (실행중인 컨테이너에 액세스 가능) | ||
ENV JAR_PATH ${JAR_PATH} | ||
|
||
# ENV 이용해서 실행 | ||
CMD java -jar ${JAR_PATH}/app.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,59 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.1' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id "org.sonarqube" version "4.0.0.2929" | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.1' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id "org.sonarqube" version "4.0.0.2929" | ||
} | ||
|
||
group = 'org.dnd' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
sourceCompatibility = '17' | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-aop' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testRuntimeOnly 'com.h2database:h2' | ||
|
||
// third-party | ||
implementation group: 'com.auth0', name: 'java-jwt', version: '4.3.0' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-aop' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' | ||
implementation("org.springframework.boot:spring-boot-devtools") | ||
|
||
|
||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
runtimeOnly("com.h2database:h2") | ||
|
||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testRuntimeOnly 'com.h2database:h2' | ||
|
||
// third-party | ||
implementation group: 'com.auth0', name: 'java-jwt', version: '4.3.0' | ||
|
||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} | ||
|
||
sonar { | ||
properties { | ||
property "sonar.projectKey", "dnd-10th-2-backend" | ||
} | ||
properties { | ||
property "sonar.projectKey", "dnd-10th-2-backend" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.7' | ||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
environment: # 환경 변수 설정 | ||
- SPRING_DATASOURCE_URL=jdbc:h2:file:/usr/src/app/data/mydb;DB_CLOSE_ON_EXIT=FALSE | ||
platform: linux/amd64 | ||
ports: | ||
- "8080:8080" | ||
# h2data 볼륨을 컨테이너 내부의 /usr/src/app/data에 매핑 | ||
volumes: | ||
- h2data:/usr/src/app/data | ||
|
||
# 볼륨 정의 (기본 설정 사용) | ||
volumes: | ||
h2data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.