Linux application runtime
Overview
Clever Cloud platform provides a multi-runtime environment, including many tools to deploy and run your applications. The Linux runtime is a versatile solution to build and deploy any kind of application. The Mise package manager helps you to install and manage any supported dependencies Clever Cloud doesn’t provide by default such as Dart, Gleam, Zig for example.
Linux is a new runtime. Help us to improve it by reporting any issue or suggestion on the Clever Cloud Community
Create your Linux application
To create a new Linux application, use the Clever Cloud Console or Clever Tools:
clever create --type linux
Configure your Linux application
Mandatory needs
Linux runtime only requires a CC_RUN_COMMAND
to execute, with a working web application listening on 0.0.0.0:8080
.
Build phase
During the build phase, Clever Cloud will run the CC_BUILD_COMMAND
if provided. You can use it to install dependencies, compile your code, or any other task you need to perform before running your application.
Use Mise package manager to define build/run commands
If you define build
and run
tasks in the mise.toml
file or as File Tasks, Clever Cloud will automatically use them. CC_BUILD_COMMAND
and CC_RUN_COMMAND
have precedence over the build
and run
tasks defined by Mise.
Clever Task and Multi-runtime approach
Linux runtime is perfect fit to run on-demand workloads on Clever Cloud: configure an application as Tasks from the Information
panel in the Console or with Clever Tools:
clever create --type linux --task "your-task-command --and arguments"
clever deploy # or clever restart if there is no code change
Expand your toolbox with Mise package manager
Install tools with Mise package manager
Mise package manager is a powerful tool to install and manage dependencies on Clever Cloud. Just add a mise.toml
file at the root of your project or set the CC_MISE_FILE_PATH
environment variable. All tools will be installed at the defined version before the build phase and available for your scripts. You can also use Mise to define environment variables and alias (tasks) in a declarative way.
To disable Mise, set CC_DISABLE_MISE
environment variable to true
.
Mise configuration examples
- Deploy a Dart application with Mise
- Deploy a Swift application with Mise
- Deploy a Zig application with Mise
Use Redirection.io as a proxy
Redirection.io can help reduce HTTP traffic issues on your website. It gives a complete control on how HTTP requests are handled, which helps make it SEO-friendly. It can perform redirections and comes with lots of features. You can link any application to a Redirection.io project easily, setting up the proxy mode with following environment variables:
Name | Description | Default value |
---|---|---|
CC_ENABLE_REDIRECTIONIO | Enable Redirection.io support | false |
CC_REDIRECTIONIO_PROJECT_KEY | The Redirection.io project key | |
CC_REDIRECTIONIO_FORWARD_PORT | The listening port of your application | |
CC_REDIRECTIONIO_INSTANCE_NAME | The name of your application (optional) |
The Redirection.io agent will start as a service, listen to 8080
port and forward the traffic to your application port.
Use Varnish as cache
Varnish is a powerful HTTP accelerator that can be used to cache your web application’s responses, improving performance and reducing load. To use it, create a Varnish configuration file in clevercloud/varnish.vcl
and configure your application to listen on port 8081
.
Did this documentation help you ?