Skip to content

Commit d40bc2c

Browse files
committed
refactor : 운영환경별 YML 분리 및 배포 환경 설정 구조 개선
1 parent 2cf9630 commit d40bc2c

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

.github/workflows/test-server-cd.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
--name $NEW_CONTAINER \
6161
--network common \
6262
-e SPRING_PROFILES_ACTIVE=server \
63+
# DB
6364
-e SPRING_DATASOURCE_URL="${{secrets.TEST_DB_URL}}" \
6465
-e SPRING_DATASOURCE_USERNAME="${{secrets.TEST_DB_USERNAME}}" \
6566
-e SPRING_DATASOURCE_PASSWORD="${{secrets.TEST_DB_PASSWORD}}" \
@@ -72,7 +73,8 @@ jobs:
7273
-e SPRING_RABBITMQ_USERNAME="${{secrets.TEST_RABBITMQ_USERNAME}}" \
7374
-e SPRING_RABBITMQ_PASSWORD="${{secrets.TEST_RABBITMQ_PASSWORD}}" \
7475
# Redis
75-
-e redis-password-test="${{secrets.TEST_REDIS_PASSWORD}}" \
76+
-e REDIS_HOST="${{secrets.TEST_REDIS_HOST}}" \
77+
-e REDIS_PASSWORD="${{secrets.TEST_REDIS_PASSWORD}}" \
7678
# OAuth2
7779
-e kakao.client-id="${{secrets.OAUTH_KAKAO_CLIENT_ID}}" \
7880
-e google.client-id="${{secrets.OAUTH_GOOGLE_CLIENT_ID}}" \

src/main/resources/application-server.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ spring:
1010

1111
data: #RedisTemplate 등을 사용하기 위한 직접 연결용
1212
redis:
13-
host: }
13+
host: ${REDIS_HOST}
1414
port: 6379
1515
timeout: 6000
16-
password: ${redis-password}
16+
password: ${REDIS_PASSWORD}
1717
cache: #Spring Cache를 사용하기 위한 Redis
1818
type: redis
1919
redis:
@@ -38,3 +38,4 @@ sentry:
3838
send-default-pii: true
3939
environment: prod
4040
traces-sample-rate: 0.2
41+

src/main/resources/application.yml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
spring:
22
application:
33
name: back
4+
45
profiles:
56
active: dev
7+
68
output:
79
ansi:
810
enabled: always
11+
912
datasource:
1013
hikari:
1114
auto-commit: false
15+
1216
jackson:
1317
serialization:
1418
fail-on-empty-beans: false
19+
1520
jpa:
1621
show-sql: true
1722
hibernate:
1823
ddl-auto: create-drop
24+
1925
properties:
2026
hibernate:
2127
format_sql: true
2228
highlight_sql: true
2329
use_sql_comments: true
30+
2431
config:
2532
import: optional:classpath:application-secrets.yml
33+
2634
servlet:
2735
multipart:
2836
max-file-size: 10MB
2937
max-request-size: 10MB
38+
39+
# Spring AI 설정
3040
ai:
3141
openai:
3242
base-url: https://api.groq.com/openai # 내부 서버를 groq으로
@@ -35,6 +45,8 @@ spring:
3545
options:
3646
model: meta-llama/llama-4-scout-17b-16e-instruct
3747
temperature: 0
48+
49+
# RabbitMQ 설정
3850
rabbitmq:
3951
host: ${SPRING_RABBITMQ_HOST:localhost}
4052
port: 5672
@@ -46,19 +58,63 @@ spring:
4658
enabled: true
4759
initial-interval: 2000
4860
max-attempts: 3
61+
4962
data: #RedisTemplate 등을 사용하기 위한 직접 연결용
5063
redis:
5164
host: localhost
5265
port: 6379
5366
timeout: 6000
54-
password: ${redis-password}
67+
5568
cache: #Spring Cache를 사용하기 위한 Redis
5669
type: redis
5770
redis:
5871
time-to-live: 300000
5972
cache-null-values: false
6073
key-prefix:
6174

75+
#OAuth2 설정
76+
security:
77+
oauth2:
78+
client:
79+
registration:
80+
kakao:
81+
client-id: ${kakao.client-id}
82+
scope:
83+
- profile_nickname
84+
- profile_image
85+
authorization-grant-type: authorization_code
86+
google:
87+
client-id: ${google.client-id}
88+
client-secret: ${google.client-secret}
89+
scope:
90+
- profile
91+
authorization-grant-type: authorization_code
92+
provider:
93+
kakao:
94+
authorization-uri: https://kauth.kakao.com/oauth/authorize
95+
token-uri: https://kauth.kakao.com/oauth/token
96+
user-info-uri: https://kapi.kakao.com/v2/user/me
97+
user-name-attribute: id
98+
google:
99+
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth
100+
token-uri: https://oauth2.googleapis.com/token
101+
user-info-uri: https://www.googleapis.com/oauth2/v3/userinfo
102+
user-name-attribute: sub
103+
104+
#S3 설정
105+
cloud:
106+
aws:
107+
credentials:
108+
access-key: ${aws.access-key}
109+
secret-key: ${aws.secret-key}
110+
region:
111+
static: ap-northeast-2
112+
s3:
113+
bucket: ${aws.bucket}
114+
stack:
115+
auto: false
116+
117+
#Spring doc 설정
62118
springdoc:
63119
default-produces-media-type: application/json;charset=UTF-8
64120
logging:
@@ -93,3 +149,9 @@ jwt:
93149
access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY}
94150
refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY}
95151

152+
naver:
153+
client_id: ${NAVER_CLIENT_ID}
154+
client_secret: ${NAVER_CLIENT_SECRET}
155+
156+
liveblocks:
157+
secret-key: ${liveblocks-secret-key}

0 commit comments

Comments
 (0)