Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Step 1: Build the application in a Maven container with Corretto 11
FROM docker-registry.dexguru.biz/dex.guru/utils/maven:3.8.1-jdk-11-slim AS build
# Step 1: Build the application in a Maven container with Corretto 17
FROM docker-registry.dexguru.biz/dex.guru/utils/maven:3.8.1-jdk-17-slim AS build

# Set the working directory in the Docker container
WORKDIR /app
Expand All @@ -11,13 +11,13 @@ COPY src ./src/
# Build the application
RUN mvn clean package

# Step 2: Use Amazon Corretto 11 base image to run the application
FROM docker-registry.dexguru.biz/dex.guru/utils/amazoncorretto:11
# Step 2: Use Amazon Corretto 17 base image to run the application
FROM docker-registry.dexguru.biz/dex.guru/utils/amazoncorretto:17

# Set the working directory in the Docker container
WORKDIR /app

# Copy the built application from the Maven container to the Corretto 11 container
# Copy the built application from the Maven container to the Corretto 17 container
COPY --from=build /app/target/chainflow-engine.jar /app/

# Set the entry point to run the application
Expand Down
15 changes: 10 additions & 5 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<camunda.version>7.19.0</camunda.version>
<springBoot.version>2.7.9</springBoot.version>

<maven.compiler.source>1.11</maven.compiler.source>
<maven.compiler.target>1.11</maven.compiler.target>
<version.java>1.11</version.java>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<version.java>17</version.java>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
Expand Down Expand Up @@ -261,6 +261,11 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>

</dependencies>

Expand Down Expand Up @@ -315,8 +320,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
<source>18</source>
<target>18</target>
</configuration>
</plugin>
</plugins>
Expand Down
37 changes: 37 additions & 0 deletions engine/src/main/java/com/guru/engine/config/OpenApiConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.guru.engine.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApiConfig {

@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("Guru Engine API")
.description("API documentation for Guru Engine including Camunda BPM endpoints")
.version("1.0")
.contact(new Contact()
.name("Guru Team")
.email("support@guru.com"))
.license(new License()
.name("Apache 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.html")));
}

@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("public")
.packagesToScan("com.guru.engine.controller", "org.camunda.bpm.engine.rest")
.pathsToMatch("/**")
.build();
}
}
9 changes: 9 additions & 0 deletions engine/src/main/java/com/guru/engine/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.guru.engine.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
// Using default static resource handling
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.guru.engine.controller;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/test")
public class TestController {

@GetMapping("/check-file")
public ResponseEntity<String> checkFile() {
try {
Resource resource = new ClassPathResource("static/openapi/openapi.json");
if (resource.exists()) {
return ResponseEntity.ok("File exists at: " + resource.getURL().toString());
} else {
return ResponseEntity.ok("File does not exist");
}
} catch (IOException e) {
return ResponseEntity.ok("Error checking file: " + e.getMessage());
}
}
}
23 changes: 23 additions & 0 deletions engine/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,26 @@ mindsdb.url=${MINDS_DB_HOST:http://127.0.0.1:47334}
mindsdb.openai.api.key=${OPENAI_API_KEY:sk-key}
openai.api.key=${OPENAI_API_KEY:sk-key}
rapidApi.api.key=${RAPID_API_KEY:rapid-ke}

# OpenAPI Configuration
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.packagesToScan=com.guru.engine.controller,org.camunda.bpm.engine.rest
springdoc.pathsToMatch=/**
springdoc.default-consumes-media-type=application/json
springdoc.default-produces-media-type=application/json

# Serve static OpenAPI specification
springdoc.swagger-ui.url=/openapi/openapi.json
springdoc.api-docs.enabled=false

# Static content configuration
spring.web.resources.static-locations=classpath:/static/
spring.mvc.static-path-pattern=/**
spring.web.resources.chain.enabled=true
spring.web.resources.chain.compressed=true
spring.web.resources.chain.html-application-cache=true

# Swagger UI configuration
springdoc.swagger-ui.config-url=/openapi/openapi.json
springdoc.swagger-ui.disable-swagger-default-url=true
Loading