fixing cors for prod

This commit is contained in:
2026-01-20 22:41:51 -05:00
parent 8001ea2b4c
commit 9c8bb13fb0
5 changed files with 11 additions and 5 deletions

View File

@@ -19,7 +19,6 @@ RUN mvn clean package -DskipTests
# Use a smaller Java Runtime Environment (JRE) image for a smaller footprint # Use a smaller Java Runtime Environment (JRE) image for a smaller footprint
FROM eclipse-temurin:21-jre FROM eclipse-temurin:21-jre
ENV SPRING_PROFILES_ACTIVE=prod
# Set the working directory in the final image # Set the working directory in the final image
WORKDIR /app WORKDIR /app

View File

@@ -11,8 +11,8 @@ services:
- SPRING_DATASOURCE_URL=jdbc:postgresql://ash.gofwd.group:5433/ss_builder - SPRING_DATASOURCE_URL=jdbc:postgresql://ash.gofwd.group:5433/ss_builder
- SPRING_DATASOURCE_USERNAME=dba - SPRING_DATASOURCE_USERNAME=dba
- SPRING_DATASOURCE_PASSWORD=!@#Qwerty - SPRING_DATASOURCE_PASSWORD=!@#Qwerty
- SPRING_PROFILES_ACTIVE=prod - SPRING_PROFILES_ACTIVE=openai,prod
- AI_ENRICHMENT_PROVIDER=off - AI_ENRICHMENT_PROVIDER=openai
networks: networks:
- app-network - app-network

View File

@@ -33,7 +33,8 @@ public class CorsConfig {
"https://localhost:3000/gunbuilder", "https://localhost:3000/gunbuilder",
"http://localhost:3000/gunbuilder", "http://localhost:3000/gunbuilder",
"https://localhost:3000/builder", "https://localhost:3000/builder",
"http://localhost:3000/builder" "http://localhost:3000/builder",
"https://battl.builders"
)); ));
// Allow all headers // Allow all headers

View File

@@ -10,6 +10,7 @@ import group.goforward.battlbuilder.enrichment.repo.ProductEnrichmentRepository;
import group.goforward.battlbuilder.model.Product; import group.goforward.battlbuilder.model.Product;
import group.goforward.battlbuilder.repos.ProductRepository; import group.goforward.battlbuilder.repos.ProductRepository;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -17,6 +18,11 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service
@ConditionalOnProperty(
name = "ai.enrichment.provider",
havingValue = "openai",
matchIfMissing = false
)
public class AiEnrichmentOrchestrator { public class AiEnrichmentOrchestrator {
private final EnrichmentModelClient modelClient; private final EnrichmentModelClient modelClient;

View File

@@ -79,6 +79,6 @@ app.beta.invite.tokenMinutes=30
ai.minConfidence=0.75 ai.minConfidence=0.75
ai.openai.apiKey=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 ai.openai.apiKey=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
ai.openai.model=gpt-4.1-mini ai.openai.model=gpt-4.1-mini
ai.enrichment.provider=off ai.enrichment.provider=openai
spring.jackson.serialization.fail-on-empty-beans=false spring.jackson.serialization.fail-on-empty-beans=false