I too have used GCP to host a Spring-Boot service. I followed this article almost religiously provided by Spring Boot(https://www.baeldung.com/spring-boot-google-app-engine) as well as this github read me that includes extra information about preparing your service to be hosted onto GCP (https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/springboot-appengine-standard)
- The main idea is that you will need to create a CLOUD SQL instance if you are using MySQL, and then add some configurations in your applications.properties (https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory)
- You will need to package your Spring-Boot services to either a jar or a war. I used a war because I was able to find more resources. This is done in your
pom.xml
. - You will need to include all the right GCP packages to be able to host onto gcp in your pom.xml
- You will need to create some sort of runtime configuration by creating an
appengine/app.yaml
file - You will need to extend a
Servlet
class in your main application file so that GCP has a main endpoint when any call is made to utilize your Spring-Boot services