diff --git a/.github/workflows/CI-CD_Pipeline.yml b/.github/workflows/CI-CD_Pipeline.yml index abdd710b..9733e2fa 100644 --- a/.github/workflows/CI-CD_Pipeline.yml +++ b/.github/workflows/CI-CD_Pipeline.yml @@ -239,7 +239,7 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - instance-ids: "i-084a4704f4e017cc4" + instance-ids: "i-04e6cdbebfead7150" working-directory: / comment: Deploy command: | @@ -270,6 +270,9 @@ jobs: PROD_REDIS_PORT=6379 PROD_REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }} + RROD_QDRANT_HOST=qdrant_1 + RROD_QDRANT_PORT=6334 + send_email_address=${{ secrets.SEND_EMAIL_ADDRESS }} email_address=${{ secrets.EMAIL_ADDRESS }} send_email_password=${{ secrets.EMAIL_PASSWORD }} diff --git a/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java b/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java index 6e20d14d..1442d72f 100644 --- a/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java +++ b/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java @@ -64,7 +64,7 @@ public PasswordEncoder passwordEncoder() { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(List.of("http://localhost:3000, https://www.trybalaw.com")); + configuration.setAllowedOrigins(List.of("http://localhost:3000, https://www.trybalaw.com, https://api.trybalaw.com")); configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); configuration.setAllowedHeaders(List.of("*")); configuration.setAllowCredentials(true); diff --git a/backend/src/main/resources/application-prod.yml b/backend/src/main/resources/application-prod.yml index f5bc1cf8..325f1219 100644 --- a/backend/src/main/resources/application-prod.yml +++ b/backend/src/main/resources/application-prod.yml @@ -28,3 +28,10 @@ spring: host: ${PROD_REDIS_HOST} port: ${PROD_REDIS_PORT} password: ${PROD_REDIS_PASSWORD} + ai: + vectorstore: + qdrant: + host: ${PROD_QDRANT_HOST} + port: ${RROD_QDRANT_PORT} + collection-name: legal_cases + vector-size: 1536 \ No newline at end of file diff --git a/infra/main.tf b/infra/main.tf index ec6216b2..cc2bf4e9 100644 --- a/infra/main.tf +++ b/infra/main.tf @@ -271,6 +271,23 @@ CREATE DATABASE \`${var.app_1_db_name}\`; FLUSH PRIVILEGES; " +# Qdrant 설치 +docker run -d \ + --name qdrant_1 \ + --restart unless-stopped \ + --network common \ + -p 6333:6333 \ + -p 6334:6334 \ + qdrant/qdrant + +# Qdrant healthcheck 대기 +echo "Qdrant가 준비될 때까지 대기 중..." +until curl -fs http://localhost:6333/healthz > /dev/null; do + echo "Qdrant가 아직 준비되지 않음. 5초 후 재시도..." + sleep 5 +done +echo "Qdrant 준비 됨" + echo "${var.github_access_token_1}" | docker login ghcr.io -u ${var.github_access_token_1_owner} --password-stdin END_OF_FILE