appstack

App Stack

This repository has automation for various application deployments on the Oracle Cloud Infrastructure (OCI) using serverless resources such as Container Instances and Autonomous Database. In the current version only Java applications are supported.

The Container Instances service is an ideal deployment platform as it is serverless and cost effective.

Target Applications

Web applications Server-side HTML applications, a.k.a. servlets or Java Server Pages Back-end servers REST APIs

App Stack for Java

App Stack for Java is a customizable Terraform Stack designed to automate the deployment of Java applications (the backend only) in a serverless infrastructure. Follow the instructions below to learn how to utilize the stack to seamlessly deploy Java applications to Container Instances, creating a production-ready environment.

Deploy to Oracle Cloud

Blueprint architecture

Your Java application can be packaged in 3 ways:

  1. As source code: this is the most valuable use case. Your source code can be in a github repo and mirrored in OCI DevOps (see details below). The stack will create a build pipeline that:
    • Builds a container image of your application using your build instructions (for example ‘mvn install’). The container image uses JDK17 to run your application.
    • Automatically deploys new versions of the git branch you have selected during the configuration.
  2. As a Java artifact (JAR or WAR): the stack configures the JDBC DataSource for the selected Database and creates a build pipeline that:
    • Builds a container image of your application by either executing the Jar (JDK17 is used) or deploying the War in Tomcat 9.
    • Automatically deploys new versions of the artifact.
  3. As a container image: your application is already packaged in a container image published in the container registry.

In all cases the deployment is done on Container Instances behind a load balancer.

Release and status

Prerequisites

For deploying your Java App with the App Stack, here is the list of OCI prerequisites.

Which Cloud Resources will be used?

The Oracle Cloud Free Tier service allows you to build, test, and deploy your applications on Oracle Cloud for free. Upon signing up, the service comes with a $300 credit with 30 days expiration; following the expiration or the exhaustion of the credit, most of the provisioned services remain available as Always Free. You may add additional credit for services that do not fall under Always-Free.

Usage Instructions

Please refer to the usage instructions for details about each field of the stack form.

What will the stack do?

Destroying the stack

Before you can destroy the stack and all the resources that have been created you must manually delete the artifact that the stack has created under the “Artifact Registry”.

Tutorial

MyTodoList SpringBoot application tutorial.

Contributing

This project welcomes contributions from the community. Before submitting a pull request, see CONTRIBUTING for details.

License

Copyright (c) 2023, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. See LICENSE for more details.

Support

Please review the troubleshooting document. For support you can file issues on GitHub. You can also send an email to the product team at “appstack_ww at oracle.com”.

Appendix

Build instructions

To build the zip on a mac from this directory:

zip -r ../appstackforjava.zip . -x "*.git*" -x "*.DS_Store" -x "images/*" -x "listing/*" -x "*.md" -x "troubleshooting/*" -x "tutorials/*" -x "screenshots/*" -x "*.md"

To manually create the Stack on OCI: