Try WSO2 Cloud for Free
Sign in
Skip to end of metadata
Go to start of metadata

You can deploy applications of the following types in WSO2 Integration Cloud:

  • Integration: WSO2 ESB and Ballerina applications.
  • Services: Web apps, PHP, Jaggery, WSO2 Data Services, Java Microservices, JAX-RS, and JAX-WS.
  • Custom: Any application type using Docker images.

You can deploy any type of application as a custom Docker image in the Integration Cloud. First, upload your Docker image to a docker registry (e.g., the Docker Hub) and then create applications using it. At the moment, you can only use images in public registries. We will soon extend this facility to private registries as well.

In this tutorial, you deploy a NodeJS application in WSO2 Integration Cloud using a Docker image.

Let's get started!

Tip: Don't have a custom Docker image yet?

 Click here for instructions to create a custom Docker image...
  1. Install Docker on your machine if you haven't done so already.

  2. Download this sample NodeJS to your machine. Alternatively, you can use your own sample.

  3. Create an account in Docker Hub if you do not have one already.
  4. Go to the sample folder and execute the following command to create a Docker image in Docker Hub.

    docker build -t <your_docker_hub_user_name>/<desired_docker_image_name>:<desired_tag> .
    For example: docker build -t maheshcwso2/node-js-hello:nonroot8080 .
    
    docker push

    Tip: Be sure to note the following when writing the Docker file:

    • Do not use the VOLUME command in the docker file (i.e., no host mounting).
    • Do not use the root user for the container.

      RUN useradd -ms /bin/bash nonRootUser
      USER nonRootUser
    • Avoid SSH services running inside the container.
  5. The Docker image is pushed to Docker Hub. Copy its URL.

  1. Log in to WSO2 Integration Cloud by going to http://wso2.com/cloud/, clicking the Sign In link, and then selecting WSO2 Integration Cloud.
  2. The Integration Cloud opens. Click CREATE APPLICATION
     
  3. Click the Custom Docker Images link under Custom.


    As you use the custom Docker image option for the first time, you do not have any existing Docker images to create applications from. Therefore, you are directed to a page to upload a new Docker image first. 
  4. Give the URL of your custom Docker image and click Add Image. In this example, we use this Docker Hub URL: maheshcwso2/node-js-hello:nonroot8080.

  5. Note that the image that you uploaded is added to a test queue to be validated. The time taken for validation varies depending on the size of the image.
     
  6. Note that the security test's status turns green if the validation is successful.

    You have now uploaded a custom Docker image to WSO2 Integration Cloud. Next, let's create an application using this image.
  7. Click the Integration Cloud heading to return to the home page and then click CREATE APPLICATION.
  8. Click the Custom Docker Images link under Custom.
  9. Add the following information in the form that opens, scroll down, and click Create:
    • Custom Image: Select the image that you created earlier
    • Application Name: MyJSApp
    • Runtime (Under Advanced settings...): Select the 8080 runtime if your application runs on port 8080. If it runs on a WSO2 server, which runs on 9443 and 9763, select the other runtime. For now, we support only two runtimes according to the ports that are exposed in the contains. We will make this more customizable in the future. 
  10. The created application opens in the Integration Cloud. Click its URL to launch it.
  11. Note that the application runs on your browser.

You have created a NodeJS application using a custom Docker image.

  • No labels