Skip to content

Commit

Permalink
Merge pull request #42 from choboss00/feature/3-branch-mentoring
Browse files Browse the repository at this point in the history
배포를 위한 도커파일 생성, ide 환경설정, 테이블명 변경
  • Loading branch information
sjmjys954646 authored Oct 22, 2023
2 parents a32e84f + 9235ae5 commit de4b282
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 6 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
version = '1.0'

java {
sourceCompatibility = '11'
Expand Down Expand Up @@ -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') {
Expand All @@ -60,3 +63,7 @@ tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}

jar {
enabled = false
}
1 change: 1 addition & 0 deletions goorm.manifest
Original file line number Diff line number Diff line change
@@ -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":"[email protected]","author_name":"sda587744","ignore_patterns":[],"project_domain":[{"id":"2884683018_g77z4_kakao-oidc","url":"boysq-akbanloprb.krampoline.com","port":"80"}],"visibility":2}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'demo'
rootProject.name = 'kakao'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions src/main/resources/application-ide.yml
Original file line number Diff line number Diff line change
@@ -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/
30 changes: 30 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit de4b282

Please sign in to comment.