blog image

Cloud native deoployment of the fullstack app in Oracle Cloud Infrastructure

Make time to market and Return of Investment as quick as possible by deploying fullstack application to the cloud. We will demonstrate an usace using Oracle Cloud Infrastructure /OCI/ cloud.

Our fullstack application consist of :

  • React UI microservice
  • backend microservice exposing REST API for persistance, integration and orchestration of the user flows. 
  • relational database Postgree sql
  • load balancer to consume incomming traffic from users and customers
poliklinikabezrucova

The process to achieve go live can be divided into 4 phases :

  1. Development and containerization
  2. Provisioning of the needed cloud services
  3. Deployment to the cloud

This blog will demonstrate these phases tailored to the OCI.

Development of the frontend and the backend microservice and containerization

After developing locally with Docker desktop /Quarkus supports provisioning DB as container/ and testing the microservices needs to be delivered as a container. Here is an example to dockerize quarkus backend app:

./mvnw clean 
./mvnw package 
docker build -f src/main/docker/Dockerfile.jvm -t quarkus/backend-service-jvm .
docker run -i --rm -p 8080:8080 quarkus/backend-service-jvm

Provisioning of the needed cloud services

1.Postgre SQL in OCI

Navigate Databases->PostgreSQL->Database systems

Click Create PostrgreSQL Database system and complete the flow. To manage the db best use bastion, this will be described in separate blog

Youd db service is ready and you db name is matching your development

postgresql1

In quarkus the configuration for the database is in ./resources/application.properties

# Database Configuration
quarkus.datasource.db-kind = postgresql
quarkus.datasource.username = usernamechange
quarkus.datasource.password = passwdchange
quarkus.datasource.jdbc.url = jdbc:postgresql://10.10.10.167:5432/namedb
quarkus.datasource.jdbc.max-size=16

2. Provisioning of the Container Registry

Navigate to Container & Artifacts->Container Registry and click Create repository

Choose name e.g. backend-service

contaonersregistry1

3. Provision VCN

 Provision Virtual Cloud Network with Internet Gateway, Service Gateway, NAT, 1 public and 1 private subnets

vcn1

4. Provision Load Balancer

Navigate to Networking -> Load balancers -> Load balancer

Create Load balancer, assign public IP address . Backend set will be added later


Deployment to the cloud

1. Push container to the OCI created registry

docker login fra.ocir.io
docker images
docker tag ebd899d08ad8 fra.ocir.io/tenancyid/backend-service:latest
docker push  fra.ocir.io/tenancyid/backend-service:latest

2. Create container instances from docker images

Click Create container instance, public ip is not needed because we are using load balancer with public ip with backend set to private ip. Select image and provide important login and password to the container registry.

containerinstance1

containerinstance2

containerinstance3

3. Configure backend to the load balancer

 lb2

 There are much more cloud native possible configurations and upgrades such as using API Gateway, CI/CD configruation with B/G deployments, up/down sizing based on load, security and firewall configurations.

Contact CCW to tailor you cloud native solution in OCI fast, efficient and in highest quality.

Before we begin: take a look at the processing of your personal data

If you visit a site that records cookies, a small text file will be created on your computer and stored in your browser. The next time you visit the same page, it will help you connect to the web faster. Our website will offer you relevant information and make it easier for you to work.

We mainly use cookies for anonymous traffic analysis and to improve our website. If you set your browser to block cookies, it is possible that the website will slow down and some parts of the website may not work completely correctly. More info on the processing of cookies.