728x90
프로파일 설정
--spring.pofiles.active=프로파일명
ex) --spring.pofiles.active=local
ex) --spring.pofiles.active=server
application.yml
server:
port: 8080
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
spring:
h2:
console:
enabled: true
path: /h2
datasource:
url: jdbc:h2:mem:test
# profiles:
# active: local // 로컬 프로파일 사용을 위한 설정
jpa:
hibernate:
ddl-auto: update
profiles:
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
properties:
hibernate:
default_batch_fetch_size: 100
data:
web:
pageable:
one-indexed-parameters: true
jwt:
key:
secret: ${JWT_SECRET_KEY}
access-token-expiration-minutes: 1440
refresh-token-expiration-minutes: 1440
application-local.yml : MySQL 사용
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/<스키마_명>
username: DB_명
password: DB_비밀번호
jpa:
hibernate:
ddl-auto: create
defer-datasource-initialization: true
sql:
init:
data-locations: classpath:static/db/data.sql
mode: always
decorator:
datasource:
p6spy:
enable-logging: true
file:
img: /Users
iam:
access-key: local
secret-key: local
region: local
cloud:
aws:
region:
static: ap-northeast-2
stack:
auto: false
mod: local
application-server.yml : AWS 사용
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://RDS엔드포인트:RDS포트번호/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
username: RDS 아이디
password: RDS 비밀번호
jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
hibernate:
ddl-auto: update
defer-datasource-initialization: true
# sql:
# init:
# data-locations: classpath:static/db/data.sql
# mode: always
decorator:
datasource:
p6spy:
enable-logging: true
file:
img: Img/ # 각 이미지 파일 저장 경로
iam:
access-key: ${IAM_ACCESS_KEY}
secret-key: ${IAM_SECRET_KEY}
region: ap-northeast-2
cloud:
aws:
region:
static: ap-northeast-2
stack:
auto: false
mod: server
Test의 application.yml : h2사용
server:
port: 8080
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test
username: sa
password:
jpa:
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
hibernate:
default_batch_fetch_size: 100
defer-datasource-initialization: true
sql:
init:
data-locations: classpath:static/db/data.sql
mode: always
data:
web:
pageable:
default-page-size: 10
one-indexed-parameters: true
jwt:
key:
secret: ${JWT_SECRET_KEY}
access-token-expiration-minutes: 30
refresh-token-expiration-minutes: 420
file:
img: Img/
iam:
access-key: ${IAM_ACCESS_KEY}
secret-key: ${IAM_SECRET_KEY}
region: ap-northeast-2
cloud:
aws:
region:
static: ap-northeast-2
stack:
auto: false
mod: server
728x90
'Java & Spring > 프로젝트 기본 설정' 카테고리의 다른 글
[SpringBoot] API 문서화 세팅 (asciidoctor) (0) | 2022.11.04 |
---|---|
[SpringBoot] 프로젝트 워크 플로우 (0) | 2022.11.03 |
[SpringBoot] build.gradle 설명 및 기본설정 (0) | 2022.10.23 |
[SpringBoot] Advice (진행중) (0) | 2022.10.20 |
[SpringBoot] Exception (진행중) (0) | 2022.10.20 |