diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..bb7298ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Stage 1: Build the application +FROM krmp-d2hub-idock.9rum.cc/goorm/gradle:7.3.1-jdk17 + +# 작업 디렉토리 설정 +WORKDIR /home/gradle/project + +# Spring 소스 코드를 이미지에 복사 +COPY . . + +# gradle 빌드 시 proxy 설정을 gradle.properties에 추가 +RUN echo "systemProp.http.proxyHost=krmp-proxy.9rum.cc\nsystemProp.http.proxyPort=3128\nsystemProp.https.proxyHost=krmp-proxy.9rum.cc\nsystemProp.https.proxyPort=3128" > /root/.gradle/gradle.properties +# gradlew를 이용한 프로젝트 빌드 +RUN gradle wrapper + +RUN ./gradlew clean build + +# 서버가 실행될 때 사용되는 포트 +EXPOSE 8080 + +# 빌드 결과 jar 파일을 실행 +CMD ["java", "-jar", "-Dspring.profiles.active=prod", "/home/gradle/project/build/libs/kakao-1.0.jar"] \ No newline at end of file diff --git a/build.gradle b/build.gradle index d968f0d9..1110e796 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { } group = 'com.example' -version = '0.0.1-SNAPSHOT' +version = '1.0' java { sourceCompatibility = '11' @@ -49,6 +49,9 @@ dependencies { // swagger implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0' implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0' + + // kargo, ide + runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' } tasks.named('test') { @@ -60,3 +63,7 @@ tasks.named('asciidoctor') { inputs.dir snippetsDir dependsOn test } + +jar { + enabled = false +} \ No newline at end of file diff --git a/goorm.manifest b/goorm.manifest new file mode 100644 index 00000000..847f0c17 --- /dev/null +++ b/goorm.manifest @@ -0,0 +1 @@ +{"storage":"container","type":"jsp","detailedtype":"spring_gradle","author":"2884683018_g77z4_kakao-oidc","name":"Team18_BE","description":"18조","date":"2023/10/18 18:45:47","plugins":{"goorm.plugin.jsp":[{"plugin.jsp.source_path":"src/main/java","plugin.jsp.build_path":"build/","plugin.jsp.deploy_path":"goormService/tomcat7/webapps/","plugin.jsp.spring.source_path":"src/main/java"}]},"is_user_plugin":false,"show_preview_btn":true,"author_email":"sda587744@daum.net","author_name":"sda587744","ignore_patterns":[],"project_domain":[{"id":"2884683018_g77z4_kakao-oidc","url":"boysq-akbanloprb.krampoline.com","port":"80"}],"visibility":2} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 0a383dd8..52c9fe0f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'demo' +rootProject.name = 'kakao' diff --git a/src/main/java/com/example/demo/mentoring/contact/NotConnectedRegisterUser.java b/src/main/java/com/example/demo/mentoring/contact/NotConnectedRegisterUser.java index 9424081a..ba5ea63d 100644 --- a/src/main/java/com/example/demo/mentoring/contact/NotConnectedRegisterUser.java +++ b/src/main/java/com/example/demo/mentoring/contact/NotConnectedRegisterUser.java @@ -16,8 +16,8 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @Entity @Where(clause = "deleted_at IS NULL") -@SQLDelete(sql = "UPDATE not_connected_register_user_tb SET deleted_at = CURRENT_TIMESTAMP, isDeleted = TRUE where id = ?") -@Table(name = "notConnectedRegisterUser_tb") +@SQLDelete(sql = "UPDATE not_connected_register_users SET deleted_at = CURRENT_TIMESTAMP, isDeleted = TRUE where id = ?") +@Table(name = "not_connected_register_users") public class NotConnectedRegisterUser extends BaseTime { @Id diff --git a/src/main/java/com/example/demo/mentoring/done/ConnectedUser.java b/src/main/java/com/example/demo/mentoring/done/ConnectedUser.java index 010926e5..779cb7a8 100644 --- a/src/main/java/com/example/demo/mentoring/done/ConnectedUser.java +++ b/src/main/java/com/example/demo/mentoring/done/ConnectedUser.java @@ -16,8 +16,8 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @Entity @Where(clause = "deleted_at IS NULL") -@SQLDelete(sql = "UPDATE connected_user_tb SET deleted_at = CURRENT_TIMESTAMP, isDeleted = TRUE where id = ?") -@Table(name = "connectedUser_tb") +@SQLDelete(sql = "UPDATE connected_users SET deleted_at = CURRENT_TIMESTAMP, isDeleted = TRUE where id = ?") +@Table(name = "connected_users") public class ConnectedUser extends BaseTime { @Id diff --git a/src/main/resources/application-ide.yml b/src/main/resources/application-ide.yml new file mode 100644 index 00000000..8a62d3cf --- /dev/null +++ b/src/main/resources/application-ide.yml @@ -0,0 +1,32 @@ +server: + servlet: + encoding: + charset: utf-8 + force: true + port: 8080 +spring: + datasource: + url: jdbc:mariadb://localhost:3306/kakao?allowPublicKeyRetrieval=true&useSSL=false + driver-class-name: org.mariadb.jdbc.Driver + username: root + password: root + jpa: + database-platform: org.hibernate.dialect.MySQLDialect + hibernate: + ddl-auto: validate + show-sql: true + properties: + hibernate: + format_sql: true + default_batch_fetch_size: 100 + open-in-view: false + mvc: + pathmatch: + matching-strategy: ant_path_matcher # spring 2.6 ↑ +logging: + level: + '[com.example.kakao]': DEBUG + '[org.hibernate.type]': TRACE + +file: + path: ./images/ \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 00000000..6b37afeb --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,30 @@ +server: + servlet: + encoding: + charset: utf-8 + force: true + port: 8080 +spring: + datasource: + url: ${DATABASE_URL}?allowPublicKeyRetrieval=true&useSSL=false + driver-class-name: org.mariadb.jdbc.Driver + username: root + password: root + hibernate: + ddl-auto: none + show-sql: true + properties: + hibernate: + format_sql: true + default_batch_fetch_size: 100 + open-in-view: false + mvc: + pathmatch: + matching-strategy: ant_path_matcher # spring 2.6 ↑ +logging: + level: + '[com.example.kakao]': INFO + '[org.hibernate.type]': TRACE + +file: + path: ./images/ \ No newline at end of file