AppSail Configurations

Startup Commands

You can configure startup commands for your AppSail services that specify starting up the app based on the programming stack, framework, application files, and the web server used. Essentially, this is the command that you would provide in your local environment to start up an application with your configured server.

Startup commands can be configured while deploying the app from the CLI during the deployment, or directly in the console after the app is deployed in the cloud.

Note: Configuring startup commands are optional for apps deployed as custom runtimes. This is because, you can add the startup command directly in the OCI image's definition. However, you can still configure it after the app is deployed in the console and override the pre-defined command.

The startup command can be configured for an app in two ways:


Startup Commands for Catalyst-Managed Runtimes

Java:

Java applications typically include embedded servers in the app’s code, based on the framework used. For example, Spring Boot apps come bundled with web servers by default. However, certain frameworks or formats might not include servers by default, and you will need to configure an embedded server independently in your Java code. Some common web servers that are used are Eclipse Jetty or Apache Tomcat.

Note: Catalyst supports two formats for Java applications: Java WAR and Java SE. When you initialize a Java app as a WAR file, you need not provide any embedded server for your app, as Catalyst bundles it with the Jetty server by default. You therefore need not provide any startup commands either. Catalyst will handle the application startup. However, you will need to embed a server if you select the Java SE option and provide startup commands accordingly. You can go through the Java Help Guide for some examples.

Node.js and Python:

For Node.js and Python applications, depending on the frameworks you use, deployment servers might be included as a part of the framework. You will need to configure and manage application servers accordingly, and provide appropriate startup commands for your apps. Catalyst does not provide any built-in support for any servers for these programming environments.


Certain frameworks expect the HTTP listen port to be specified in the command line while starting the server.

For example:

copy
python3 -m http.server ${X_ZOHO_CATALYST_LISTEN_PORT}

However, in AppSail, the startup commands are executed directly without any involving any shell operations. Therefore, when needed, you must specify the startup command to be executed as a shell command for any shell completions.

For example:

copy
sh -c 'python3 -m http.server ${X_ZOHO_CATALYST_LISTEN_PORT}'

Environment Variables

Environment variables are declared outside of the main source code and can be referred to, when needed. Catalyst enables you to store and manage variables for both the development and production environments. Declare a single variable and configure values for both these environments. For example, if you need to declare an auth token variable that will hold different values in both environments, you can do so.

You can configure environment variables for Catalyst-managed runtime apps and for custom runtime apps. These will be pushed to the platform instance when your service is spawned, and they can be accessed with runtime-specific code.

Note: If you want to declare a production variable, you must have deployed your project to the Production environment. You will not be able to access production variables if your project is not deployed, or if the production environment is disabled.

AppSail allows you to configure environment variables in two ways:

Use an Environment Variable

After you create an environmental variable, you can call it in your app’s code by its keyname in different ways in different programming environments. The syntax for each programming environment is given below:

  • Java:
copy
System.getenv(variable_name)
  • Node.js:
copy
process.env.[variable_name]
  • Python:
copy
os.getenv(variable_name)

variable_name: The keyname declared for the variable

Note: The variable's value is fetched based on the environment the app is invoked in. That is, if the development URL of the app is invoked, the development value of the variable is fetched, and vice versa.

Memory and Disk Allocation

You can allocate memory for your app’s execution based on its load and performance requirements. If you do not specifically configure a memory for your app, the default memory of 512 MB will be allocated for its execution. You can also allocate the disk space needed for your app based on its size. The default storage allocated for your app will be 256 MB as well.

You can always edit and re-configure the memory and storage after you analyze your app’s requirements based on its performance, and optimize it further.

AppSail allows you to configure the memory in two ways:


Ports for App Executions

AppSail listens through HTTP ports and grants network access in your application. That is, all the incoming connections to the app will be listened for through a specific port. You can configure the listening port in Catalyst by referring to the environment variable key X_ZOHO_CATALYST_LISTEN_PORT in your application code and connect to the Internet. Catalyst will check for the process listening on this port.

Refer to the Help Guide section for examples of configuring the AppSail listen port in your application’s code.

Note: You can assign a port you need for your AppSail service. Ports within the range of 0 to 1024 are reserved, with the exception of ports 80 and 443. You can use any port other than these. Port 9000 will be used by default.

Depending on the framework of your runtime, you might need to specify the HTTP listen port in your startup command while starting the server.

Last Updated 2025-11-03 16:18:29 +0530 IST