- Multi-stage Dockerfile (Maven + Node build, JRE runtime) - Gitea Actions CI: build → docker → deploy - K8s manifests: Deployment, Service (NodePort 30082), Ingress - ServiceAccount + RBAC for kubectl access from pod - Docker socket mount for image builds - Ingress at deploy.cameleer.siegeln.net - SPA config for serving frontend from Spring Boot - cameleer-demo namespace for deployed apps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
975 B
Java
26 lines
975 B
Java
package com.cameleer.deploy.config;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
/**
|
|
* Serves the SPA frontend. All non-API, non-static paths forward to index.html
|
|
* so that client-side routing works.
|
|
*/
|
|
@Configuration
|
|
public class SpaConfig implements WebMvcConfigurer {
|
|
@Override
|
|
public void addViewControllers(ViewControllerRegistry registry) {
|
|
// Forward non-API paths to index.html for SPA routing
|
|
registry.addViewController("/").setViewName("forward:/index.html");
|
|
}
|
|
|
|
@Override
|
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
registry.addResourceHandler("/**")
|
|
.addResourceLocations("classpath:/static/", "file:static/");
|
|
}
|
|
}
|