Skip to content

Overview

The Nullstone Builder provides a way to automatically build applications from source code. It can be used for any type of application including building a Docker image for containers, building assets for static sites, and producing zip files for serverless. When the builder completes, Nullstone will automatically push the artifact to your application infrastructure. Subsequently, Nullstone will perform a deployment of your new application code to the environment.

Container

For container applications, the Nullstone Builder will build a Docker image from your source code and push it to your container registry. Nullstone executes the following command to build your Docker image:

shell
docker build --file <Dockerfile> --tag=<image-name> [--build-arg=<key>=<value> ...] <docker-context>

# Default configuration
docker build --file Dockerfile --tag=<image-name> .

During the build process, Nullstone injects --build-arg flags using the application's environment variables. See Build Environment Variables for more info about which environment variables are injected.

Serverless

For serverless applications, the Nullstone Builder can build a zip file or docker image depending on the type of application. If you are using a docker image, refer to the Container section above.

If you are using a zip file, the Nullstone Builder will build a zip file from your source code and push it to your storage bucket. Nullstone executes the following command to build your zip file:

shell
zip -r <zip-filename> <publish-directory>

In essence, there is no "build" process yet for zip applications. Instead, it is packaging files that are available in your repository.

Static Site

For static site applications, the Nullstone Builder will build the static assets from your source code and push them to your storage bucket. (The storage bucket is used to serve the assets for your static site.)

Nullstone executes your build commands in an isolated environment using node:lts-alpine Docker image:

shell
cd <build-directory>
<install-dependencies-command>
<build-command>

During the build process, Nullstone injects the application's environment variables. See Build Environment Variables for more info about which environment variables are injected.

Build Environment Variables

During the build process, Nullstone injects the application's environment variables into the build process. This table lists the type of environment variables that are injected into the build process.

Env VariablesInjected?
Built-inYes
User-definedYes
GeneratedNo

Built-in Environment Variables

  • NULLSTONE_STACK
  • NULLSTONE_APP
  • NULLSTONE_ENV
  • NULLSTONE_VERSION
  • NULLSTONE_COMMIT_SHA

Interpolation

The Nullstone builder supports Env Var Interpolation in environment variable values. For the build process, you can only interpolate values from environment variables that are injected.

Example: CUSTOM_ENV_VAR=app.{{ NULLSTONE_ENV }}.example.com