Skip to main content

Java Spring Boot App

Java flow This guide deploys a Java Spring Boot application to ComputeSphere.

info

We use a pre-built ComputeSphere container image in this guide.

Prerequisites​

Step 1: Setting Up the Project​

Use a Pre-built Image​

You can use our pre-built Docker image on the ComputeSphere registry. Here's the image tag that we'll use.

quay.io/computesphere/computesphere-java-springboot-example:latest

Use Your Docker Image​

These steps guide you in creating an image based on our project example.

  1. Clone the project example:
git clone https://github.com/computesphere-samples/computesphere-java-springboot-example.git
  1. Create the Docker image:
docker build -t computesphere-java-springboot-example:v0.0.1 .
  1. Tag and Push the Docker image:
docker tag computesphere-java-springboot-example:v0.0.1 [REPOSITORY]/computesphere-java-springboot-example:v0.0.1

docker push [REPOSITORY]/computesphere-java-springboot-example:v0.0.1
info

Replace [REPOSITORY] with the name of your image registry repository.

Step 2: Create a Project​

  1. Login to your ComputeSphere console → click on New Project.

New Project


  1. Provide a name for the project, then click Create.

Click Create

Step 3: Create a new service​

  1. Inside your project page, click New Service.

Click New Service


  1. Click New App Service.

Click New App Service


  1. Click Deploy Image.

Click Deploy Image


Step 4: Configure and Deploy the Service​

  1. Provide a name for the service and click Next.

Click Next


  1. In the dropdown, click Create New Environment. In this section, you can add application environment variables, such as General Variables or Secret Variables. The variables are key-value pairs.
info

For more information regarding Environment, please see here.


Click Create New Environment


  1. Provide the name and the region for the environment → click Create → click Next.

Click Next


  1. Put the ComputeSphere pre-built image link: quay.io/computesphere/computesphere-java-springboot-example:latest.
info

If you have your own docker container image, change the URL to your image URL.

Put the ComputeSphere URL


  1. Select the number of Spherelets to allocate. In this example, we're going to use 4 Spherelets.

Spherelets to allocate


  1. You can choose to add storage to your service. In this example, we won't use one.

add storage


  1. You can enable health checks by setting the configurations. For this example, we'll keep the default settings.
info

For more information regarding Health Checks, please see here.


setting the path, port, delay, and interval


  1. Specify the port  → click Deploy. For this example, we use the 8080 port. Select the Public Access for network access.
info

For more information regarding Networking, please see here.


Fill in the port


  1. Wait for the deployment to finish → new screen appears with details about your deployed application.

Click Open Website


That's it. Now, you have successfully deployed your application to ComputeSphere.