From 9305dfdb7f413c49748459cfedfbc8f2b388d97d Mon Sep 17 00:00:00 2001 From: cherry2250 Date: Tue, 28 Oct 2025 16:19:51 +0900 Subject: [PATCH] =?UTF-8?q?application.yml=20=ED=86=B5=ED=95=A9=20?= =?UTF-8?q?=EB=B0=8F=20Azure=20Blob=20Storage=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - application-dev.yml, application-local.yml 삭제 - 단일 application.yml로 통합 (user-service 형식 참고) - Azure Blob Storage connection string 기본값 추가 - Redis, Actuator, Logging 상세 설정 추가 - OpenAPI/Swagger 설정 추가 - CORS 설정 추가 - 모든 설정을 환경 변수로 관리 가능하도록 구성 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- content-service/build.gradle | 4 + .../src/main/resources/application-dev.yml | 45 ----------- .../src/main/resources/application-local.yml | 43 ---------- .../src/main/resources/application.yml | 81 ++++++++++++++++--- 4 files changed, 74 insertions(+), 99 deletions(-) delete mode 100644 content-service/src/main/resources/application-dev.yml delete mode 100644 content-service/src/main/resources/application-local.yml diff --git a/content-service/build.gradle b/content-service/build.gradle index 17c9c23..fa8e188 100644 --- a/content-service/build.gradle +++ b/content-service/build.gradle @@ -2,9 +2,13 @@ configurations { // Exclude JPA and PostgreSQL from inherited dependencies (Phase 3: Redis migration) implementation.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-jpa' implementation.exclude group: 'org.postgresql', module: 'postgresql' + } dependencies { + + implementation 'org.springframework.boot:spring-boot-starter-actuator' + // Redis for AI data reading and image URL caching implementation 'org.springframework.boot:spring-boot-starter-data-redis' diff --git a/content-service/src/main/resources/application-dev.yml b/content-service/src/main/resources/application-dev.yml deleted file mode 100644 index 6c0abb8..0000000 --- a/content-service/src/main/resources/application-dev.yml +++ /dev/null @@ -1,45 +0,0 @@ -spring: - application: - name: content-service - - data: - redis: - host: ${REDIS_HOST:20.214.210.71} - port: ${REDIS_PORT:6379} - password: ${REDIS_PASSWORD:} - -server: - port: ${SERVER_PORT:8084} - -jwt: - secret: ${JWT_SECRET:kt-event-marketing-jwt-secret-key-for-authentication-and-authorization-2025} - access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:3600000} - refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY:604800000} - -azure: - storage: - connection-string: ${AZURE_STORAGE_CONNECTION_STRING:} - container-name: ${AZURE_CONTAINER_NAME:event-images} - -replicate: - api: - url: ${REPLICATE_API_URL:https://api.replicate.com} - token: ${REPLICATE_API_TOKEN:r8_Q33U00fSnpjYlHNIRglwurV446h7g8V2wkFFa} - -huggingface: - api: - url: ${HUGGINGFACE_API_URL:https://api-inference.huggingface.co} - token: ${HUGGINGFACE_API_TOKEN:} - model: ${HUGGINGFACE_MODEL:runwayml/stable-diffusion-v1-5} - -logging: - level: - com.kt.event: ${LOG_LEVEL_APP:DEBUG} - root: ${LOG_LEVEL_ROOT:INFO} - file: - name: ${LOG_FILE:logs/content-service.log} - logback: - rollingpolicy: - max-file-size: 10MB - max-history: 7 - total-size-cap: 100MB diff --git a/content-service/src/main/resources/application-local.yml b/content-service/src/main/resources/application-local.yml deleted file mode 100644 index eb843f8..0000000 --- a/content-service/src/main/resources/application-local.yml +++ /dev/null @@ -1,43 +0,0 @@ -spring: - datasource: - url: jdbc:h2:mem:contentdb - username: sa - password: - driver-class-name: org.h2.Driver - - h2: - console: - enabled: true - path: /h2-console - - jpa: - database-platform: org.hibernate.dialect.H2Dialect - hibernate: - ddl-auto: create-drop - show-sql: true - properties: - hibernate: - format_sql: true - dialect: org.hibernate.dialect.H2Dialect - - data: - redis: - # Redis 연결 비활성화 (Mock 사용) - repositories: - enabled: false - host: localhost - port: 6379 - - autoconfigure: - exclude: - - org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration - - org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration - -server: - port: 8084 - -logging: - level: - com.kt.event: DEBUG - org.hibernate.SQL: DEBUG - org.hibernate.type.descriptor.sql.BasicBinder: TRACE diff --git a/content-service/src/main/resources/application.yml b/content-service/src/main/resources/application.yml index 193e898..a115a4b 100644 --- a/content-service/src/main/resources/application.yml +++ b/content-service/src/main/resources/application.yml @@ -2,38 +2,97 @@ spring: application: name: content-service + # Redis Configuration data: redis: + enabled: ${REDIS_ENABLED:true} host: ${REDIS_HOST:20.214.210.71} port: ${REDIS_PORT:6379} password: ${REDIS_PASSWORD:Hi5Jessica!} + timeout: ${REDIS_TIMEOUT:2000ms} + lettuce: + pool: + max-active: ${REDIS_POOL_MAX:8} + max-idle: ${REDIS_POOL_IDLE:8} + min-idle: ${REDIS_POOL_MIN:0} + max-wait: ${REDIS_POOL_WAIT:-1ms} + database: ${REDIS_DATABASE:0} -server: - port: ${SERVER_PORT:8084} - +# JWT Configuration jwt: - secret: ${JWT_SECRET:dev-jwt-secret-key-minimum-32-characters-required-for-hmac-sha256} + secret: ${JWT_SECRET:kt-event-marketing-jwt-secret-key-for-authentication-and-authorization-2025} access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:3600000} refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY:604800000} +# Azure Blob Storage Configuration azure: storage: - connection-string: ${AZURE_STORAGE_CONNECTION_STRING:} - container-name: ${AZURE_CONTAINER_NAME:event-images} + connection-string: ${AZURE_STORAGE_CONNECTION_STRING:DefaultEndpointsProtocol=https;AccountName=blobkteventstorage;AccountKey=tcBN7mAfojbl0uGsOpU7RNuKNhHnzmwDiWjN31liSMVSrWaEK+HHnYKZrjBXXAC6ZPsuxUDlsf8x+AStd++QYg==;EndpointSuffix=core.windows.net} + container-name: ${AZURE_CONTAINER_NAME:content-images} +# Replicate API Configuration (Stable Diffusion) replicate: api: url: ${REPLICATE_API_URL:https://api.replicate.com} token: ${REPLICATE_API_TOKEN:} + model: + version: ${REPLICATE_MODEL_VERSION:stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b} +# HuggingFace API Configuration +huggingface: + api: + url: ${HUGGINGFACE_API_URL:https://api-inference.huggingface.co} + token: ${HUGGINGFACE_API_TOKEN:} + model: ${HUGGINGFACE_MODEL:runwayml/stable-diffusion-v1-5} + +# CORS Configuration +cors: + allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:*} + +# Actuator +management: + endpoints: + web: + exposure: + include: health,info,metrics,prometheus + base-path: /actuator + endpoint: + health: + show-details: always + show-components: always + health: + livenessState: + enabled: true + readinessState: + enabled: true + +# OpenAPI Documentation +springdoc: + api-docs: + path: /v3/api-docs + swagger-ui: + path: /swagger-ui.html + tags-sorter: alpha + operations-sorter: alpha + show-actuator: false + +# Logging logging: level: - com.kt.event: ${LOG_LEVEL_APP:DEBUG} + com.kt.event.content: ${LOG_LEVEL_APP:DEBUG} + org.springframework.web: ${LOG_LEVEL_WEB:INFO} root: ${LOG_LEVEL_ROOT:INFO} + pattern: + console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n" + file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" file: - name: ${LOG_FILE:logs/content-service.log} + name: ${LOG_FILE_PATH:logs/content-service.log} logback: rollingpolicy: - max-file-size: 10MB - max-history: 7 - total-size-cap: 100MB + max-file-size: ${LOG_FILE_MAX_SIZE:10MB} + max-history: ${LOG_FILE_MAX_HISTORY:7} + total-size-cap: ${LOG_FILE_TOTAL_CAP:100MB} + +# Server Configuration +server: + port: ${SERVER_PORT:8084}