How to setup Google Cloud Compute Engine for Spring Boot project?

Vijay Nathan :

I have read a lot of articles and seen many YouTube videos but did not solved my problem. I want to know what are the process do we need to follow to purchase the host machine in Google Cloud? Is it free or do we need to pay something? Along with this if I want to deploy my Spring Boot project then what action do we need to perform?

Altaf Java :

A very good article written on How to setup Google Cloud Compute Engine for Spring Boot project? .

According to this article you will have to do 2 activities.

  1. Setup Billing Information
  2. Setup the execution environment

In 1st step, you will have to signup/login using the Google Account by going https://console.cloud.google.com. Here it is mandatory to provide your debit/card details along with the cvv and you will have to pay 1 Rupee. For verification purpose, you need to upload one of the governement id proof like UID/Driving Licence/Passport and your debit/credit photo. After submiting the form, it will take less than 4 hours to activate your cloud account. After activating your account you need to create your machine and based on the machine type you will be charged but make sure for 1 year Google will not charge you anything. Google will give you $300 to spend on Google Cloud Platform products during your first 12 months. For price details you can visit here. enter image description here

In the 2nd step, you need to install your required softwares like Java, Git, Maven, PM2 etc. For ease of deployment you can use PM2 which is a process manager for the JavaScript runtime Node.js. In your Spring Boot project root directory you need to create one configuration file server.sh file which contains mvn spring-boot:run. Make this file executable by using chmod +x server.sh. To start the server you just need to type pm2 restart server. After starting the server you can even check the logs by using pm2 logs.

For better visibility & understanding I will recommend to read this complete article.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=415194&siteId=1