Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ out/
/db
!/resources/db/*.sql
mongodb
/src/main/resources/application.yml
/src/main/resources/application-dev.yml
/src/main/resources/application-stage.yml
/src/main/resources/application-prod.yml

.DS_Store
elasticsearch/
.cursorrules
Expand Down
148 changes: 148 additions & 0 deletions src/main/resources/application.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

환경 분리 작업을 별도의 yml 생성이 아닌 프로필 분리로 통일해주세요.

https://docs.spring.io/spring-boot/reference/features/profiles.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

요청 주신대로 찾아서 재작업하였습니다.
그 외 어떤 것들을 또 분기해야 할지 애매하여 데이터베이스 연결 부분만 진행하였습니다.
common에서 추가로 환경별 분리되어야 할 것이 있는지 확인 부탁드립니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
server:
port: 8080

spring:
application:
name: artrip
profiles:
active: local
config:
import: optional:file:.env[.properties]

datasource:
url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?serverTimezone=Asia/Seoul&useSSL=false&allowPublicKeyRetrieval=true
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
connection-timeout: 30000
maximum-pool-size: 10
minimum-idle: 5

data:
redis:
host: localhost
port: 63799

jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQLDialect
hibernate:
ddl-auto: update
show-sql: false
properties:
hibernate:
format_sql: false

devtools:
restart:
enabled: true
additional-paths: src/main/java
exclude: static/**,public/**
poll-interval: 2000
quiet-period: 1000
livereload:
enabled: true
port: 35729

servlet:
multipart:
max-file-size: 2MB
max-request-size: 10MB
Comment on lines 9 to 12
Copy link
Contributor

Choose a reason for hiding this comment

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

해당 프로퍼티는 모든 환경에서 공통이기 때문에 상단에 쓰셔도 될 것 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

servlet 프로퍼티는 상단으로 수정하였습니다.
또한 local, dev 환경 분리 작업을 하여 변경이 있을 속성만 분리 진행하였습니다.
prodution은 아직 사용할 단계가 아닌것같아 dev까지만 진행하였고 QA 서버에서 사용할정도로만 진행했습니다.
prodution 파일도 지금 부터 필요하면 추가 하겠습니다!


cloud:
aws:
credentials:
access-key: ${AWS_ACCESS_KEY_ID}
secret-key: ${AWS_SECRET_ACCESS_KEY}
region:
static: ${AWS_S3_REGION}
auto: false
s3:
bucket: ${AWS_S3_BUCKET_NAME}
cloudfront:
domain: ${AWS_CLOUDFRONT_DOMAIN}

security:
oauth2:
client:
registration:
kakao:
client-authentication-method: client_secret_post
client-id: ${KAKAO_CLIENT_ID}
client-secret: ${KAKAO_CLIENT_SECRET}
redirect-uri: ${KAKAO_REDIRECT_URI}
native-client-id: ${KAKAO_NATIVE_CLIENT_ID}
authorization-grant-type: authorization_code
scope: profile_nickname, account_email
client-name: Kakao

google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
redirect-uri: ${GOOGLE_REDIRECT_URI}
aod-client-id: ${GOOGLE_AOD_CLIENT_ID}
authorization-grant-type: authorization_code
scope:
- profile
- email
client-name: Google

provider:
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize
token-uri: https://kauth.kakao.com/oauth/token
user-info-uri: https://kapi.kakao.com/v2/user/me
user-name-attribute: id
google:
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth
token-uri: https://oauth2.googleapis.com/token
user-info-uri: https://www.googleapis.com/oauth2/v3/userinfo
user-name-attribute: sub

jwt:
issuer: ${JWT_ISSUER}
secret: ${JWT_SECRET}
access-token-expiration-millis: 900000
refresh-token-expiration-millis: 604800000
task:
scheduling:
pool:
size: 5
thread-name-prefix: scheduling-

firebase:
credentials:
path: ${FIREBASE_CONFIG_PATH}

external:
culturalapi:
base-url: https://apis.data.go.kr/B553457/cultureinfo
service-key: ${K_CULTURAL_INFO_CENTER_KEY}
connect-timeout: 5000
read-timeout: 60000
page-size: 50

logging:
level:
root: INFO
org.atdev.artrip: DEBUG
org.springframework.boot.devtools: DEBUG

resilience4j:
retry:
instances:
publicDataApi:
max-attempts: 3
wait-duration: 2s
retry-exceptions:
- java.io.IOException
- java.util.concurrent.TimeoutException
- org.springframework.web.reactive.function.client.WebClientResponseException$ServiceUnavailable

image:
upload:
max-size: 2097152
allowed-extensions: jpg,jpeg,png,webp
resize:
secret-key: ${RESIZE_SECRET_KEY}