Skip to main content

Build Configurations

This documentation explains Build Configurations within the Hostless provider application. Build Configurations define settings that control how Hostless prepares and packages your application code for deployment. These configurations can influence various aspects of the deployment process, including resource allocation and execution environment.

Build Configurations act as a blueprint for Hostless during the deployment process. They specify parameters related to building, packaging, and potentially running your application code before deployment to the Hostless environment.

For monorepos, Hostless separates the directory where a resource is built from the directory made available to the image builder:

  • working_directory: the app, site, worker, or cron job folder where automatic builds run.
  • build_context_directory: the repository folder available to BuildKit/Kaniko. It defaults to working_directory.
  • pre_build_command: an optional command run from build_context_directory before automatic builds. Docker builds should keep these steps in the Dockerfile.

Example:

working_directory: apps/frontend
build_context_directory: /
pre_build_command: "npm ci && npm run build --workspace packages/shared"
build:
system: auto
command: "npm run build"

How Build Configurations Affect Deployments

Build configurations can define the minimum and maximum amount of CPU (vCPU) and memory allocated to your application during the deployment process. This ensures your application has sufficient resources to build and package itself successfully.

Build Configuration Parameters

Hostless Build Configurations typically involve the following parameters:

  • Minimum Memory: This setting defines the minimum amount of memory (in MB) allocated to your application during deployment. Having enough memory ensures the build process has sufficient resources to run smoothly.
  • Maximum Memory: This parameter sets a limit on the memory allocated during deployment (in MB). This can be useful to prevent deployments from consuming excessive resources on your Hostless environment.
  • Minimum vCPU: This setting defines the minimum number of virtual CPUs allocated to your application during deployment. vCPUs provide processing power for the build process.
  • Maximum vCPU: This parameter sets a limit on the number of vCPUs allocated for deployment. This can be helpful for controlling resource usage, especially for applications with less demanding build processes.

By carefully configuring these parameters, you can optimize the deployment process for your application's specific needs. If you require more than the max capped memory or vCPU, kindly reach out to support@hostless.cloud.