gpt4 book ai didi

spring-boot - 在 App Engine 上部署 dockerized spring boot web

转载 作者:行者123 更新时间:2023-12-02 21:09:27 25 4
gpt4 key购买 nike

我有一个 Spring Boot Web 应用程序,当前部署了 Google App Engine。现在我转移到 Docker 并希望将此应用程序的 docker 镜像部署到 App Engine 上。

到目前为止,我找不到任何与此相关的文件。大部分文档解释了如何在 Tomcat 上部署 Spring boot 的 docker 镜像。有什么办法可以做到这一点?

最佳答案

首先你需要App Engine using the flexible environment ,如果你想通过 docker 镜像部署。

这是文件Building Custom Runtimes .

A custom runtime allows you to use an alternate implementation of any supported App Engine flexible environment language, or to customize a Google-provided one. It also allows you to write code in any other language that can handle incoming HTTP requests (example). With a custom runtime, the App Engine flexible environment provides and manages your scaling, monitoring, and load balancing infrastructure for you, so you can focus on building your application.



在官方情况下,他们有 docker 的样本 DockeFile。但是您可以忽略 docker 部分,只需让您的 Spring Boot 应用程序可执行并运行它。
FROM gcr.io/google-appengine/jetty
ADD test-webapp-1.0-SNAPSHOT.war $JETTY_BASE/webapps/root.war
WORKDIR $JETTY_BASE
RUN java -jar $JETTY_HOME/start.jar --approve-all-licenses --add-to-startd=jmx,stats,hawtio

&& chown -R jetty:jetty $JETTY_BASE

关于spring-boot - 在 App Engine 上部署 dockerized spring boot web,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55678013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com