зеркало из https://github.com/microsoft/Oryx.git
20 KiB
20 KiB
Oryx configuration
Oryx provides configuration options through environment variables so that you can apply minor adjustments and still utilize the automatic build process. The following variables are supported today:
NOTE: In Azure Web Apps, these variables are set as App Settings.
Setting name | Description | Default | Example |
---|---|---|---|
PRE_BUILD_COMMAND | Command to a shell script to be run before build | "" | echo foo |
PRE_BUILD_SCRIPT_PATH | A repo-relative path to a shell script to be run before build | "" | scripts/prebuild.sh |
POST_BUILD_COMMAND | Command to a shell script to be run after build | "" | echo foo |
POST_BUILD_SCRIPT_PATH | A repo-relative path to a shell script to be run after build | "" | scripts/postbuild.sh |
ENABLE_DYNAMIC_INSTALL | Enable dynamically install platform binaries if not presented inside the image | various | true , false |
ORYX_SDK_STORAGE_BASE_URL | The storage base url from where oryx dynamically install sdks | "https://oryx-cdn.microsoft.io" | |
DYNAMIC_INSTALL_ROOT_DIR | Root directory path under which dynamically installed SDKs are created. | various | "/opt", "tmp/platforms/oryx" |
DISABLE_CHECKERS | Disable running version checkers during the build. | false |
true , false |
ORYX_DISABLE_TELEMETRY | Disable Oryx command line tools from collecting any data. | false |
true , false |
ORYX_APP_TYPE | Type of application that the the source directory has. | "" | 'functions','static-sites', 'webapps'. |
DISABLE_RECURSIVE_LOOKUP | Indicates if detectors should consider looking into sub-directories for files | false |
true , false |
ENABLE_MULTIPLATFORM_BUILD | Apply more than one toolset if repo indicates it | false |
true , false |
PLATFORM_NAME | Specify which platform the app is using. Possible values are: nodejs, hugo, python, dotnet, php, ruby, java. | "" | "python" |
PLATFORM_VERSION | Specify which platform version the app is using | "" | "3.7.1" |
REQUIRED_OS_PACKAGES | Indicate if it requires OS packages for Node or Python packages | false |
true , false |
CREATE_PACKAGE | Indicate if it should create packages for the app | false |
true , false |
Setting name for .NET apps | Description | Default | Example |
---|---|---|---|
DOTNET_VERSION | Specify which .NET version the app is using | "" | "5.0.100" |
DOTNET_DEFAULT_VERSION | Specify which .NET version the app defaults to if none detected | "" | "5.0.100" |
DISABLE_DOTNETCORE_BUILD | Do not apply .NET Core build even if repo indicates it | false |
true , false |
PROJECT | repo-relative path to directory with .csproj file for build |
"" | "src/WebApp1/WebApp1.csproj" |
MSBUILD_CONFIGURATION | Configuration (Debug or Release) that is used to build a .NET Core project | Release |
Debug , Release |
Setting name for Nodejs apps | Description | Default | Example |
---|---|---|---|
NODE_VERSION | Specify which Node version the app is using | "" | "14.15.0" |
NODE_DEFAULT_VERSION | Specify which Node version the app defaults to if none detected | "" | "14.15.0" |
DISABLE_NODEJS_BUILD | Do not apply Node.js build even if repo indicates it | false |
true , false |
CUSTOM_BUILD_COMMAND | Custom build command to be run to build Node app | "" | "npm ci" |
RUN_BUILD_COMMAND | Custom run build command to be run after package install commands | "" | "npm run build" |
ENABLE_NODE_MONOREPO_BUILD | Apply node monorepo build if repo indicates it | false |
true , false |
COMPRESS_DESTINATION_DIR | Indicates if the entire output directory needs to be compressed. | "" | false |
PRUNE_DEV_DEPENDENCIES | Only the prod dependencies are copied to the output for Node apps. | "" | false |
NPM_REGISTRY_URL | Specify the npm registry url. | "" | "http://foobar.com/" |
YARN_TIMEOUT_CONFIG | Specify the yarn timeout config with a delay in milliseconds. | "" | "600000" |
Setting name for Python apps | Description | Default | Example |
---|---|---|---|
PYTHON_VERSION | Specify which Python version the app is using | "" | "2.7.1" |
PYTHON_DEFAULT_VERSION | Specify which Python version the app defaults to if none detected | "" | "2.7.1" |
DISABLE_PYTHON_BUILD | Do not apply Python build even if repo indicates it | false |
true , false |
VIRTUALENV_NAME | Specify Python virtual environment name | "" | "antenv2.7" |
DISABLE_COLLECTSTATIC | Disable running collectstatic when building Django apps. |
false |
true , false |
CUSTOM_REQUIREMENTSTXT_PATH | Specify where a requirements.txt is locating. If not set, default is at root of the repo. | "" | "subdir/requirements.txt" |
PYTHON_ENABLE_GUNICORN_MULTIWORKERS | Enable Gunicorn multi worker multi thread config. | false |
true , false |
PYTHON_GUNICORN_CUSTOM_WORKER_NUM | Only works when PYTHON\_ENABLE\_GUNICORN\_MULTIWORKERS is set to true . Specify Gunicorn multi worker number. If not set, default is (2 * CPU core num) + 1 |
(2 * CPU core num) + 1 , 1 |
"2" |
PYTHON_GUNICORN_CUSTOM_THREAD_NUM | Only works when PYTHON\_ENABLE\_GUNICORN\_MULTIWORKERS is set to true . Specify Gunicorn multi thread number. If not set, default is single thread. |
"" | "4" |
ORYX_DISABLE_PIP_UPGRADE | Remove the --upgrade flag from the pip install command when targeting a specific package installation directory. | false |
true , false |
NGINX_CONF_FILE | Specify a customized configuration file to modify nginx.conf file | "" | "newconfigfile.conf" |
Setting name for Php apps | Description | Default | Example |
---|---|---|---|
PHP_VERSION | Specify which Php version the app is using | "" | "7.4" |
PHP_DEFAULT_VERSION | Specify which Php version the app defaults to if none detected | "" | "7.4" |
PHP_COMPOSER_VERSION | Specify which Php composer version the app is using | "" | "7.2.15" |
PHP__COMPOSER_DEFAULT_VERSION | Specify which Php composer version the app defaults to if none detected | "" | "7.2.15" |
DISABLE_PHP_BUILD | Do not apply Php build even if repo indicates it | false |
true , false |
FPM_MAX_CHILDREN | The maximum number of child processes to be created | 5 |
"20" |
FPM_START_SERVERS | The number of child processes created on startup | min_spare_servers + (max_spare_servers - min_spare_servers) / 2 |
"10" |
FPM_MAX_SPARE_SERVERS | The desired maximum number of idle server processes | 3 |
"15" |
FPM_MIN_SPARE_SERVERS | The desired minimum number of idle server processes | 1 |
"5" |
Setting name for Java apps | Description | Default | Example |
---|---|---|---|
JAVA_VERSION | Specify which Java version the app is using | "" | "14.0.2" |
JAVA_DEFAULT_VERSION | Specify which Java version the app defaults to if none detected | "" | "14.0.2" |
MAVEN_VERSION | Specify which Maven version the app is using | "" | "3.6.3" |
MAVEN_DEFAULT_VERSION | Specify which Maven version the app defaults to if none detected | "" | "3.6.3" |
DISABLE_JAVA__BUILD | Do not apply Java build even if repo indicates it | false |
true , false |
Setting name for Ruby apps | Description | Default | Example |
---|---|---|---|
RUBY_VERSION | Specify which Ruby version the app is using | "" | "2.7.1" |
RUBY_DEFAULT_VERSION | Specify which Ruby version the app defaults to if none detected | "" | "2.7.1" |
DISABLE_RUBY__BUILD | Do not apply Ruby build even if repo indicates it | false |
true , false |
Setting name for Hugo apps | Description | Default | Example |
---|---|---|---|
HUGO_VERSION | Specify which Hugo version the app is using | "" | "0.76.3" |
HUGO_DEFAULT_VERSION | Specify which Hugo version the app defaults to if none detected | "" | "0.76.3" |
DISABLE_HUGO_BUILD | Do not apply Hugo build even if repo indicates it | false |
true , false |
Setting name for Golang apps | Description | Default | Example |
---|---|---|---|
GOLANG_VERSION | Specify which Golang version the app is using | "" | "0.76.3" |
GOLANG_DEFAULT_VERSION | Specify which Golang version the app defaults to if none detected | "" | "0.76.3" |
DISABLE_GOLANG_BUILD | Do not apply Golang build even if repo indicates it | false |
true , false |
Oryx generated manifest file
oryx-manifest.toml
is the orxy-generated manifest file involved in 2 stages (build & run). Full flow explanation by platforms.
First the build stage will build the application and autogenerate oryx-manifest.toml
.
Secondly oryx-manifest.toml
is used in the runtime to determine how to run the application. The following are fields supported today inside oryx-manifest.toml
:
Node fields | Description | Example |
---|---|---|
NodeVersion | Platform's version that Oryx will use to run the app | "14.15.1" |
OutputDirPath | Output is in separate volume due to rsync errors | ".nuxt" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "nodejs" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
nodejs_npm_registry_url | URL of the npm registry | "https://foobar.com/" |
Golang fields | Description | Example |
---|---|---|
GolangVersion | Platform's version that Oryx will use to run the app | "1.17" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "golang/hello-world/" |
PlatformName | Name of Oryx supported platform name | "golang" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
Python fields | Description | Example |
---|---|---|
PythonVersion | Platform's version that Oryx will use to run the app | "3.8.6" |
virtualEnvName | Name of the virtual environment running in the Docker container | "pythonenv3.8" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "python" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
packagedir | Packages will be downloaded to given directory instead of VM. Optional field, must be set as ENV var or passed in as a property in oryx command. |
"." (Example command: oryx build python-flask-sample-app/ --package --property packagedir=. ) |
packagewheel | Wheels are built with universal flag. packagedir parameter is required |
"universal" (Example command: oryx build python-flask-sample-app/ --package --property packagedir=. --property packagewheel=universal ) |
compress_virtualenv | Determines if app is compressed. When running the app, virtual env must be extracted from this file. Default is false | "false" |
Dotnet fields | Description | Example |
---|---|---|
DotNetCoreSdkVersion | Platform's version that Oryx will use to run the app | "3.1.406" |
StartupDllFileName | Executable used to run the application | "NetCoreApp31.MvcApp.dll" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "dotnet" |
CompressDestinationDir | Determines whether app is compressed to allow decompression, for performance improvements | "false" |
OutputType | OutputType specified in .csproj |
"Library" |
Php fields | Description | Example |
---|---|---|
PhpVersion | Platform's version that Oryx will use to run the app | "8.0.3" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "php" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
Ruby fields | Description | Example |
---|---|---|
RubyVersion | Platform's version that Oryx will use to run the app | "2.7.2" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "ruby" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
Java fields | Description | Example |
---|---|---|
JavaVersion | Platform's version that Oryx will use to run the app | "11.0.8" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "java" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |
Hugo fields | Description | Example |
---|---|---|
HugoVersion | Platform's version that Oryx will use to run the app | "0.81.0" |
OperationId | Used to correlate with logs. Track telemetries whether build is passed or failed. | "|lTpVCq2KGuY=.e6f14074_" |
SourceDirectoryInBuildContainer | Directory inside Docker container containing source code | "nodejs/helloworld-nuxtjs/" |
PlatformName | Name of Oryx supported platform name | "hugo" |
CompressDestinationDir | Determines whether app is compressed to allow decompression for performance improvements | "false" |