Skip to content
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
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ out/
### VS Code ###
.vscode/

### Application Config ###
application.yml
application-dev.yml
application-prod.yml
application-*.yml

### Docker & Environment ###
.env
52 changes: 52 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
spring:
datasource:
url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver

jpa:
hibernate:
ddl-auto: update
show-sql: true

data:
redis:
host: ${REDIS_HOST}
port: ${REDIS_PORT}

security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
authorization-grant-type: authorization_code
scope:
- email
- profile
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
naver:
client-id: ${NAVER_CLIENT_ID}
client-secret: ${NAVER_CLIENT_SECRET}
authorization-grant-type: authorization_code
scope:
- name
- email
- profile_image
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
provider:
naver:
authorization-uri: https://nid.naver.com/oauth2.0/authorize
token-uri: https://nid.naver.com/oauth2.0/token
user-info-uri: https://openapi.naver.com/v1/nid/me
user-name-attribute: response

server:
port: ${SERVER_PORT}

jwt:
secret: ${JWT_SECRET}
access-token-expiration: 1800000 # 30분 (밀리초)
refresh-token-expiration: 604800000 # 7일 (밀리초)
33 changes: 33 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
spring:
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${MYSQL_USER}
password: ${MYSQL_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver

jpa:
hibernate:
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:update} # 운영에서도 테이블 자동 생성
show-sql: ${SPRING_JPA_SHOW_SQL:false} # 운영에서는 SQL 로그 비활성화

data:
redis:
host: ${SPRING_DATA_REDIS_HOST:redis} # docker-compose의 redis 서비스명
port: ${SPRING_DATA_REDIS_PORT:6379}

security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
scope:
- email
- profile
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"

jwt:
secret: ${JWT_SECRET}
access-token-expiration: ${JWT_ACCESS_TOKEN_EXPIRATION:1800000} # 30분
refresh-token-expiration: ${JWT_REFRESH_TOKEN_EXPIRATION:604800000} # 7일