Deploying a SpringBoot Application to Oracle App Container – Part 2/2

In the first part of this blog, I have created a simple SpringBoot application and tested it locally. In this second part I am going to deploy this application to Oracle Application Container Cloud Service.

Package the App as a JAR file

Type mvn package under app_home. This creates the sample-accs-1.0.jar package under /target.

Manifest.json

This file tells Oracle ACCS how to run our application. Insert the following in manifest.json file and place it under /target.

{
    "runtime": {
        "majorVersion": "8"
    },
    "command": "java -jar sample-accs-1.0.jar",
    "notes": "Sample Application"
}

Under /target type the command below to zip the sample-accs-0.1.jar file and manifest.json file together.

> zip accs.zip manifest.json sample-accs-1.0.jar

Deploy to Oracle ACCS

Go to https://apaas.europe.oraclecloud.com/apaas and sign in. The URL might be a little different for you based on your the data center. Once logged in, click Create Application and select Java SE. Give the app a name like SampleApp and choose accs.zip as the Archive file.

You can also tell Oracle ACCS how many instances do you like to have to host your application. I will go with defaults here. Click Create.

After a few minutes, the application is ready at the specified URL

Same application can now be accessed at URL https://sampleapp-gse00003349.apaas.em2.oraclecloud.com/cars

You can of course add or delete some cars using a REST client like Postman just like I did with the c_u_r_l utility.

Summary

Oracle ACCS provides a simple and efficient way to run your workloads in cloud. SpringBoot is one example of those that you can easily configure and host from a lightweight container that Oracle ACCS creates for you. The complete application can be downloaded from GitHub.

Powered by WPeMatico

This entry was posted in oracle.

About

You may also like...

Comments are closed.