Skip to content

Commit

Permalink
Merge pull request #100 from KNU-HAEDAL/issue/#99
Browse files Browse the repository at this point in the history
Issue/#99
  • Loading branch information
bayy1216 authored Sep 26, 2024
2 parents 7af5965 + e953690 commit 13a49eb
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
spring: # default test profile
datasource:
url: "jdbc:h2:mem:zzansuni;MODE=MySQL"
username: "sa"
password: ""
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
sql.init.mode: never
h2:
console:
enabled: true
path: /h2-console
logging.level:
org.hibernate:
orm.jdbc.bind: trace
SQL: debug
---
spring:
config:
activate:
on-profile: local, dev, prod # dev, prod 공통 설정
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: none
defer-datasource-initialization: false
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
sql.init.mode: never
h2.console.enabled: false
---
spring: # local profile
config:
activate:
on-profile: local
datasource:
url: jdbc:mysql://localhost:3306/zzansuni?createDatabaseIfNotExist=true
username: "root"
password: "root"
jpa:
hibernate:
ddl-auto: none
---
spring: # dev,prod profile
config:
activate:
on-profile: dev, prod
datasource:
url: ${MYSQL_URL}
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
jpa:
hibernate:
ddl-auto: none
10 changes: 10 additions & 0 deletions zzansuni-api-server/app/src/main/resources/application-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
springdoc:
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
use-fqn: true # 패키지 경로를 포함한 클래스명으로 문서화 (FOR inner static class)
---
spring: # dev,prod profile
config:
activate:
on-profile: dev, prod
server-url: ${SERVER_URL}
13 changes: 13 additions & 0 deletions zzansuni-api-server/app/src/main/resources/application-flyway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spring:
flyway:
enabled: false
---
spring:
config:
activate:
on-profile: local, dev, prod
flyway:
enabled: true
baseline-on-migrate: false # Flyway가 초기화되지 않은 데이터베이스에 마이그레이션을 적용할 때 초기 버전으로 마이그레이션 파일을 적용할지 여부
fail-on-missing-locations: true # 스크립트 파일을 저장하는 위치를 못 찾을때 실패할지 여부
baseline-version: 1 # Flyway가 초기화되지 않은 데이터베이스에 마이그레이션을 적용할 때 버전을 설정
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jwt:
secret: ${JWT_SECRET:4099a46b-39db-4860-a61b-2ae76ea24c43}
access-token-expire-time: 1800000 # 30 minutes
refresh-token-expire-time: 2592000000 # 30 days
29 changes: 29 additions & 0 deletions zzansuni-api-server/app/src/main/resources/application-oauth2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
spring:
config:
activate:
on-profile: local, dev, prod # dev, prod 공통 설정
kakao:
client-id: ${KAKAO_CLIENT_ID:c959f4526a0df321dff0a8636fec3428}
naver:
client-id: ${NAVER_CLIENT_ID:Ob2i2TZtIsaNqH8j_q9X}
---
spring: # local profile
config:
activate:
on-profile: local
kakao:
client-secret: ${KAKAO_CLIENT_SECRET:placeholder}
redirect-uri: ${KAKAO_REDIRECT_URI:placeholder}
naver:
client-secret: ${NAVER_CLIENT_SECRET:placeholder}
---
spring: # dev,prod profile
config:
activate:
on-profile: dev, prod
kakao:
client-secret: ${KAKAO_CLIENT_SECRET}
redirect-uri: ${KAKAO_REDIRECT_URI}
naver:
client-secret: ${NAVER_CLIENT_SECRET}
server-url: ${SERVER_URL}
15 changes: 15 additions & 0 deletions zzansuni-api-server/app/src/main/resources/application-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring: # dev,prod profile
config:
activate:
on-profile: dev, prod
cloud:
aws:
s3.bucket: ${S3_BUCKET}
credentials:
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
region:
static: ap-northeast-2
auto: false
stack:
auto: false
108 changes: 9 additions & 99 deletions zzansuni-api-server/app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,19 @@
spring: # default test profile
datasource:
url: "jdbc:h2:mem:zzansuni;MODE=MySQL"
username: "sa"
password: ""
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
sql.init.mode: never
flyway:
enabled: false
h2:
console:
enabled: true
path: /h2-console
profiles:
include:
- flyway
- database
- jwt
- oauth2
- s3
- doc
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
resolve-lazily: true # 파일 업로드 시점에 메모리에 저장
lifecycle:
timeout-per-shutdown-phase: 15s # 스프링이 종료될때 모든 작업이 종료될때 까지 기다리는 시간
logging.level:
org.hibernate:
orm.jdbc.bind: trace
SQL: debug
springdoc:
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
use-fqn: true # 패키지 경로를 포함한 클래스명으로 문서화 (FOR inner static class)
jwt:
secret: ${JWT_SECRET:4099a46b-39db-4860-a61b-2ae76ea24c43}
access-token-expire-time: 1800000 # 30 minutes
refresh-token-expire-time: 2592000000 # 30 days
server:
shutdown: graceful
tomcat:
Expand All @@ -51,74 +27,8 @@ spring:
config:
activate:
on-profile: local, dev, prod # dev, prod 공통 설정
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: none
defer-datasource-initialization: false
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
sql.init.mode: never
h2.console.enabled: false
flyway:
enabled: true
baseline-on-migrate: false # Flyway가 초기화되지 않은 데이터베이스에 마이그레이션을 적용할 때 초기 버전으로 마이그레이션 파일을 적용할지 여부
fail-on-missing-locations: true # 스크립트 파일을 저장하는 위치를 못 찾을때 실패할지 여부
baseline-version: 1 # Flyway가 초기화되지 않은 데이터베이스에 마이그레이션을 적용할 때 버전을 설정
server:
tomcat:
threads:
max: 200 # 최대 스레드 수 (기본값 200)
min-spare: 10 # 최소 스레드 수 (기본값 10)
kakao:
client-id: ${KAKAO_CLIENT_ID:c959f4526a0df321dff0a8636fec3428}
naver:
client-id: ${NAVER_CLIENT_ID:Ob2i2TZtIsaNqH8j_q9X}
---
spring: # local profile
config:
activate:
on-profile: local
datasource:
url: jdbc:mysql://localhost:3306/zzansuni?createDatabaseIfNotExist=true
username: "root"
password: "root"
jpa:
hibernate:
ddl-auto: none
kakao:
client-secret: ${KAKAO_CLIENT_SECRET:placeholder}
redirect-uri: ${KAKAO_REDIRECT_URI:placeholder}
naver:
client-secret: ${NAVER_CLIENT_SECRET:placeholder}
---
spring: # dev,prod profile
config:
activate:
on-profile: dev, prod
datasource:
url: ${MYSQL_URL}
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
jpa:
hibernate:
ddl-auto: none
cloud:
aws:
s3.bucket: ${S3_BUCKET}
credentials:
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
region:
static: ap-northeast-2
auto: false
stack:
auto: false
kakao:
client-secret: ${KAKAO_CLIENT_SECRET}
redirect-uri: ${KAKAO_REDIRECT_URI}
naver:
client-secret: ${NAVER_CLIENT_SECRET}
server-url: ${SERVER_URL}
min-spare: 10 # 최소 스레드 수 (기본값 10)

0 comments on commit 13a49eb

Please sign in to comment.