Web+ supports deploying applications that are developed in a variety of programming languages. You can deploy a native application if the suitable technology stack is not available. This topic describes how to deploy native applications in Web+.

Introduction to native applications

  • Web+ requires manual installation of infrastructure software. You can customize the installation procedure in the Commands and lifecycle hooks sections. For example, you can use customized commands in the PostPrepareEnv section to install the required software or dependencies.
  • Web+ does not provide default start commands. You must configure start commands in the Commands section or the Procfile file.
  • In Web+, port 8080 is used as the service port of a native application by default. We recommend that you specify a service port that is specific to your environment. You can use the $WP_SERVICE_PORT environment variable to configure a service port for an application. Health checks for an application may fail if the service port is different from the listening port.
  • A native application must be able to run as expected on the AliyunLinux2.1903 operating system (environment).
  • You can attach a database to a native application. For more information, see ApsaraDB for RDS instances. You can retrieve database options that are predefined by Web+ from environment variables. To enable database access after configuring database options, you only need to select a compatible database driver. For more information about related environment variables, see Environment variables.

Archive a native application

This topic uses a simple HTTP application named simpleserver as an example. This application only includes an executable file. After the application is started, it listens on port 8080, accepts HTTP GET requests, and returns a message showing "OK".
└── simpleserver
  1. Create a file named Procfile in the project directory of the application. Add the following statement to the file.
    web: ./simpleserver
  2. Use the following command to archive the application and create a deployment package. The package is used to deploy the application in Web+.
    zip -r simpleserver.zip . /

Deploy a native application in Web+

  1. Log on to the Web+ console.
  2. On the Overview page, click Create in the upper-right corner of the Last Updated Environments section.
  3. In the Basic Information step, select Native in the Tech Stack Type field, enter an application name and description, and then click Next.
  4. In the Environment Information step, enter an environment name, select Upload Local Application in the Package Source field, upload the deployment package, and then modify the deployment package version. Click Create with Low Cost Preset after the configuration is complete.

Access an application

In the Creation Complete step, click View Application or Creation Complete to go to the Overview tab of the Application Details page. Click the name of a deployment environment to go to the Overview tab of the Environment Details page. Then, click the link next to the Public IP Address label to visit the homepage of the application.