Skip to content

Commit

Permalink
#1102 - Add recommendation service to container
Browse files Browse the repository at this point in the history
  • Loading branch information
Duy Le Van committed Oct 10, 2024
1 parent 38ee04e commit 0b5f10b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
YAS_CURRENCY_UNIT=VND

# OpenAI Config
SPRING_AI_AZURE_OPENAI_API_KEY=
SPRING_AI_AZURE_OPENAI_ENDPOINT=
SPRING_AI_AZURE_OPENAI_EMBEDDING_OPTIONS_MODEL=
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions recommendation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM eclipse-temurin:21-jre-alpine
COPY target/recommendation*.jar app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]
6 changes: 3 additions & 3 deletions recommendation/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b5f10b

Please sign in to comment.