Skip to content

Commit d785eab

Browse files
authored
Merge pull request #221 from prgrms-web-devcourse-final-project/chore/33-infra
Chore/33 infra
2 parents 333bf82 + 6fa670d commit d785eab

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

backend/src/main/resources/application-prod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ spring:
44
driver-class-name: ${PROD_DATASOURCE_DRIVER}
55
username: ${PROD_DATASOURCE_USERNAME}
66
password: ${PROD_DATASOURCE_PASSWORD}
7+
datasource-meta:
8+
jdbc-url: jdbc:mysql://localhost:3306/meta_db?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true
9+
driver-class-name: ${PROD_DATASOURCE_DRIVER}
10+
username: ${PROD_DATASOURCE_USERNAME}
11+
password: ${PROD_DATASOURCE_PASSWORD}
12+
713
hikari:
814
maximum-pool-size: 20 # 트래픽에 맞춰 조정
915
minimum-idle: 5
@@ -27,6 +33,7 @@ spring:
2733
port: ${PROD_REDIS_PORT}
2834
password: ${PROD_REDIS_PASSWORD}
2935
embedded: false
36+
3037
security:
3138
oauth2:
3239
client:
@@ -36,6 +43,12 @@ spring:
3643
naver:
3744
redirect-uri: ${PROD_OAUTH2_NAVER_REDIRECT_URI:https://api.trybalaw.com/login/oauth2/code/naver}
3845
ai:
46+
ollama:
47+
base-url: http://ollama:11434
48+
embedding:
49+
options:
50+
model: daynice/kure-v1:567m
51+
3952
vectorstore:
4053
qdrant:
4154
host: ${PROD_QDRANT_HOST}

infra/main.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,24 @@ until curl -fs http://localhost:6333/healthz > /dev/null; do
355355
done
356356
echo "Qdrant 준비 됨"
357357
358+
# 볼륨 먼저 만들기(한 번만)
359+
docker volume create ollama-data
360+
361+
# 컨테이너 실행
362+
docker run -d \
363+
--name ollama \
364+
--restart unless-stopped \
365+
--network common \
366+
-p 11434:11434 \
367+
-v ollama-data:/root/.ollama \
368+
--entrypoint /bin/sh \
369+
--health-cmd 'curl -f http://localhost:11434/api/version || exit 1' \
370+
--health-interval 10s \
371+
--health-timeout 5s \
372+
--health-retries 10 \
373+
ollama/ollama:latest \
374+
-c 'ollama serve & sleep 5 && ollama pull daynice/kure-v1:567m && wait'
375+
358376
echo "${var.github_access_token_1}" | docker login ghcr.io -u ${var.github_access_token_1_owner} --password-stdin
359377
360378
END_OF_FILE

0 commit comments

Comments
 (0)