Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/#99 #100

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +53 to +63
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev๋ž‘ prod์—์„œ ๊ฐ™์€ DB๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฑด๊ฐ€์š” ??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ๋‹ค๋ฅด๊ฒŒ ๋‘๋ฉด ๋˜๊ฒ ๋„ค์š”! ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค ~

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)
Loading