v1

Run /

Inject runtime variables

Available on combined and deployment services.

Runtime variables (ENV) can be set to be passed to the Docker container at runtime. These can be set for individual service, or set as project secrets to be applied to all or specific services in a project.

Your runtime variables can be accessed via the process environment, for example in a Node environment a variable set as ENV_VALUE=Northflank can be accessed within the container by referring to process.env.ENV_VALUE.

Runtime environmentEnvironment variable accessorRequired import
Nodeprocess.env.ENV_VALUEnone
DenoDeno.env.get("ENV_VALUE")none
Pythonos.environ.get("ENV_VALUE")import os
PHP.$_ENV["ENV_VALUE"]none
Ruby on RailsENV["ENV_VALUE"]none
Rustenv::var("ENV_VALUE")use std::env
JavaSystem.getenv("ENV_VALUE")none

Runtime variables can be set as key-value pairs, or as JSON in the following format:

{
    "KEY_1": "value1",
    "KEY_2": "value2"
}

An .env file can also be uploaded and edited using the following format:

KEY_1=value1
KEY_2=value2

© 2022 Northflank Ltd. All rights reserved.