Skip to main content
Deployment options: WSO2 Cloud

Deploy an Application with Build Presets

Using WSO2 Developer Platform, you can easily deploy applications written in different language frameworks (such as Java, Go, NodeJS, Python, Ruby, PHP, etc.) on shared or private data planes.

WSO2 Developer Platform supports deploying applications with build presets for the following component types:

  • Service
  • Web Application
  • Scheduled Task
  • Manual Task
  • Webhook
  • Event Handler
  • Test Runner

Build Presets​

Build presets are a fundamental building block in modern application development. They convert your source code into a secure, efficient, production-ready container image without a Dockerfile. With WSO2 Developer Platform, developers can take advantage of this powerful tool to effortlessly deploy their applications without the hassle of manual configuration.

WSO2 Developer Platform uses Google Buildpacks as default build presets for Java, Go, NodeJS, Python, PHP, and Ruby. WSO2 Developer Platform uses its own build presets for Ballerina and WSO2 MI.

Develop a component​

To develop a service component that exposes a Service in Go, you can follow the Develop a Service guide.

Follow the guidelines below based on your language:

Supported Versions - 3.10.x, 3.11.x

Refer below examples for different component types. Follow the readme.md inside the example.

Component TypeExample
ServiceReading Books List Service
Manual TaskHello World Task

For more examples, see WSO2 Developer Platform samples.

info

In Python projects, it is mandatory to provide a Run Command when creating a component.

Here are some example run commands for an application:
e.g.,

  • python main.py
  • gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 main:app
  • flask run --host=0.0.0.0

Configure build-time environment variables​

You can configure the environment variables necessary to build the component using the Build Configurations Editor on the component Build page.

For Buildpack components: During the build process, the build-time environment variables and their values are passed to the build preset. Therefore, you can configure both build preset-specific environment variables and those required for the component build.

For example, if you want to override the Maven command of the Java build presets, you can use GOOGLE_MAVEN_BUILD_ARGS as the environment key and clean install as the value.

For more examples, see Google Cloud's buildpacks documentation..

For BYOC (Bring Your Own Container) components: You can configure build-time environment variables that are passed as build arguments (ARG) during the Docker image build process. These variables are available during the build stage of your Dockerfile and can be used to customize the build behavior.

For example, you can set environment variables to configure build-specific settings such as build modes, feature flags, or dependency options that your Dockerfile references via ARG directives.

Customize the Default Run Command​

You can configure the run command required to start the component via the Build Configurations editor on the component's Build page. This overrides the default run command provided by the build preset. After configuring the run command, you must rebuild the component for the changes to take effect.

e.g.,

  • java -jar target/sample.jar
  • node app.js
  • php -S 0.0.0.0:8000 index.php