Nils Bühner, terrestris
FOSSGIS 2024 | 20. März 2024 | Hamburg
4.0.0
org.geoserver.cloud.apps
gs-cloud-services
${revision}
gs-cloud-wms
jar
wms-service
org.geoserver.cloud.wms.app.WmsApplication
org.geoserver.cloud
gs-cloud-starter-webmvc
org.geoserver
gs-gwc
org.geoserver
gs-wms
org.geoserver.cloud
gs-cloud-starter-wms-extensions
org.geoserver.cloud
gs-cloud-starter-security
...
...
@SpringBootApplication
@EnableRetry
public class WmsApplication {
public static void main(String[] args) {
try {
SpringApplication.run(WmsApplication.class, args);
} catch (RuntimeException e) {
try {
LoggerFactory.getLogger(WmsApplication.class).error("Application run failed", e);
} finally {
System.exit(-1);
}
}
}
}
package org.geoserver.cloud.wms.controller;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.geoserver.cloud.virtualservice.VirtualServiceVerifier;
import org.geoserver.ows.Dispatcher;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.view.RedirectView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequiredArgsConstructor
public class WMSController {
private final @NonNull Dispatcher geoserverDispatcher;
private final @NonNull org.geoserver.ows.ClasspathPublisher classPathPublisher;
private final @NonNull VirtualServiceVerifier virtualServiceVerifier;
@GetMapping("/")
public RedirectView redirectRootToGetCapabilities() {
return new RedirectView("/wms?SERVICE=WMS&REQUEST=GetCapabilities");
}
@GetMapping(path = {"/wms", "/ows"})
public void handleGet(HttpServletRequest request, HttpServletResponse response)
throws Exception {
dispatch(request, response);
}
private void dispatch(HttpServletRequest request, HttpServletResponse response)
throws Exception {
geoserverDispatcher.handleRequest(request, response);
}
}
ARG TAG=latest
FROM geoservercloud/gs-cloud-base-jre:$TAG as builder
ARG JAR_FILE=target/gs-cloud-*-bin.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
##########
FROM geoservercloud/gs-cloud-base-geoserver-image:$TAG
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./