Commit 598378fc authored by Matthias Betz's avatar Matthias Betz
Browse files

update ifcconvert, spring boot, add docker

parent aa7bf340
No preview for this file type
No preview for this file type
services:
spring-app:
build: .
container_name: ifc-converter-server
ports:
- "50000:80"
environment:
SPRING_PROFILES_ACTIVE: docker
SERVER_PORT: 80
restart: unless-stopped
\ No newline at end of file
# Start from a lightweight OpenJDK image
FROM eclipse-temurin:17-jre
# Set working directory inside the container
WORKDIR /app
# Copy the JAR file into the image
COPY convert-spring-boot.jar app.jar
# Copy IfcConvert
COPY IfcConvert /app/IfcConvert
# Ensure it's executable
RUN chmod +x /app/IfcConvert
# Expose the port your Spring Boot app runs on
EXPOSE 80
# Run the Spring Boot app
ENTRYPOINT ["java", "-jar", "app.jar"]
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>ifc-converter-server</artifactId> <artifactId>ifc-converter-server</artifactId>
<version>1.0.0</version> <version>1.1.0</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.6</version>
</parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -27,7 +35,6 @@ ...@@ -27,7 +35,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration> <configuration>
<source>17</source> <source>17</source>
<target>17</target> <target>17</target>
...@@ -44,19 +51,33 @@ ...@@ -44,19 +51,33 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.3</version>
<configuration> <configuration>
<executable>true</executable> <executable>true</executable>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>info</id>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>UTF-8</encoding.source>
<encoding.reporting>UTF-8</encoding.reporting>
<java.version>${java.version}</java.version>
</additionalProperties>
</configuration>
</execution>
<execution>
<id>package</id>
<goals> <goals>
<goal>repackage</goal> <goal>repackage</goal>
</goals> </goals>
<configuration> <configuration>
<finalName>convert</finalName> <finalName>convert</finalName>
<classifier>spring-boot</classifier> <classifier>spring-boot</classifier>
<mainClass>de.hft.stuttgart.lgl.ifc.ConverterApplication</mainClass> <mainClass>
de.hft.stuttgart.lgl.ifc.ConverterApplication</mainClass>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
...@@ -64,15 +85,4 @@ ...@@ -64,15 +85,4 @@
</plugins> </plugins>
</build> </build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
</project> </project>
\ No newline at end of file
...@@ -12,7 +12,6 @@ import java.util.List; ...@@ -12,7 +12,6 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -28,6 +27,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -28,6 +27,8 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody; import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
import jakarta.servlet.http.HttpServletRequest;
@CrossOrigin @CrossOrigin
@RestController @RestController
public class ConverterEndpoints { public class ConverterEndpoints {
......
converter.executable=ifcConvert.exe converter.executable=ifcConvert.exe
management.endpoints.web.exposure.include=info,health
management.endpoint.health.enabled=true
server.port=50000 server.port=50000
logging.file.name=backend-converter.log logging.file.name=backend-converter.log
logging.level.root=info logging.level.root=info
......
converter.executable=./IfcConvert
management.endpoints.web.exposure.include=info,health
management.endpoint.health.enabled=true
server.port=80
logging.file.name=backend-converter.log
logging.level.root=info
logging.logback.rollingpolicy.file-name-pattern=backend-converter-%d{yyyy-MM-dd}.%i.gz
logging.logback.rollingpolicy.max-file-size=10MB
# Enable multipart uploads
spring.servlet.multipart.enabled=true
# Threshold after which files are written to disk.
spring.servlet.multipart.file-size-threshold=50MB
# Max file size.
spring.servlet.multipart.max-file-size=2000MB
# Max Request Size
spring.servlet.multipart.max-request-size=2000MB
converter.executable=./IfcConvert converter.executable=./IfcConvert
management.endpoints.web.exposure.include=info,health
management.endpoint.health.enabled=true
server.port=50000 server.port=50000
logging.file.name=backend-converter.log logging.file.name=backend-converter.log
logging.level.root=info logging.level.root=info
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment