diff --git a/.env b/.env index 2f34d16058..f67fddce55 100644 --- a/.env +++ b/.env @@ -89,4 +89,9 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.search.yml:docker-compose.o11y.ym # Additional configuration YAS_PRICE_INCLUDES_TAX=false -YAS_CURRENCY_UNIT=VND \ No newline at end of file +YAS_CURRENCY_UNIT=VND + +# OpenAI Config +SPRING_AI_AZURE_OPENAI_API_KEY= +SPRING_AI_AZURE_OPENAI_ENDPOINT= +SPRING_AI_AZURE_OPENAI_EMBEDDING_OPTIONS_MODEL= \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 538fa1dab6..79a5ac90b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -497,6 +497,35 @@ services: - ./deployment/app-config:/app-config networks: - yas-network + recommendation: + build: ./recommendation + image: ghcr.io/nashtech-garage/yas-recommendation:latest + ports: + - '9791:9791' + environment: + - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/recommendation + - SERVER_SERVLET_CONTEXT_PATH=/recommendation + - YAS_PUBLIC_URL=${YAS_PUBLIC_API_URL}/recommendation + - YAS_SERVICES_PRODUCT + - SERVER_PORT + - LOGGING_CONFIG + - JAVA_TOOL_OPTIONS + - OTEL_EXPORTER_OTLP_ENDPOINT + - OTEL_EXPORTER_OTLP_PROTOCOL + - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES + - OTEL_SERVICE_NAME=recommendation-service + - OTEL_LOGS_EXPORTER + - OTEL_TRACES_EXPORTER + - OTEL_METRICS_EXPORTER + - OTEL_INSTRUMENTATION_LOGBACK-MDC_ADD-BAGGAGE + - OTEL_JAVAAGENT_LOGGING + - OTEL_JAVAAGENT_ENABLED + - OTEL_JAVAAGENT_DEBUG + # OpenAI Config + - SPRING_AI_AZURE_OPENAI_API_KEY + - SPRING_AI_AZURE_OPENAI_ENDPOINT + - SPRING_AI_AZURE_OPENAI_EMBEDDING_OPTIONS_MODEL swagger-ui: image: swaggerapi/swagger-ui:v4.16.0 environment: diff --git a/recommendation/Dockerfile b/recommendation/Dockerfile new file mode 100644 index 0000000000..e41eaeea6f --- /dev/null +++ b/recommendation/Dockerfile @@ -0,0 +1,3 @@ +FROM eclipse-temurin:21-jre-alpine +COPY target/recommendation*.jar app.jar +ENTRYPOINT ["java", "-jar", "/app.jar"] \ No newline at end of file diff --git a/recommendation/src/main/resources/application.properties b/recommendation/src/main/resources/application.properties index 6f855398f3..d9b67d02ee 100644 --- a/recommendation/src/main/resources/application.properties +++ b/recommendation/src/main/resources/application.properties @@ -27,9 +27,9 @@ spring.ai.vectorstore.pgvector.index-type=HNSW spring.ai.vectorstore.pgvector.distance-type=COSINE_DISTANCE # Azure AI configuration -spring.ai.azure.openai.api-key=xxx -spring.ai.azure.openai.endpoint=https://product-recommendation.openai.azure.com -spring.ai.azure.openai.embedding.options.model=text-embedding-3-small +spring.ai.azure.openai.api-key= +spring.ai.azure.openai.endpoint= +spring.ai.azure.openai.embedding.options.model= # swagger-ui custom path springdoc.swagger-ui.path=/swagger-ui