Environment Variables
The server will check a number of environment variables to configure itself.
Setting Environment variables
Environment variables can be set in many ways depending on the the OS and/or the tool used to launch the server. This is a list of common possible ways:
Windows Powershell:
$env:VARIABLE_NAME = "value"
(code must be run in the same shell)Windows Command Prompt:
set VARIABLE_NAME=value
(code must be run in the same shell) !! Do not use quotes as they will be included in the valueWindows Settings:
Control Panel > System > Advanced System Settings > Environment Variables
Linux BASH:
export VARIABLE_NAME=value
(code must be run in the same shell)VSCode:
launch.json > env > VARIABLE_NAME
{
"version": "0.2.0",
"configurations": [
{
...
"env": {
"VARIABLE_NAME_1": "VALUE_1",
...
},
...
}
]
}
Docker:
docker run -e VARIABLE_NAME=value ...
Docker:
docker run --env-file .env ...
where .env is a file with the format
VARIABLE_NAME_1=VALUE_1
...
VARIABLE_NAME_N=VALUE_N
Project variable list
List of environment variables used in this project to configure the application behavior.
Variable (=[default]) |
Description |
---|---|
= OPTIONAL |
Number of columns the rich logging should use if enabled. Particularly useful in docker environments if the terminal width is not detected properly. |
= OPTIONAL |
List of semi-colon |
= |
List of semi-colon |
= |
List of semi-colon |
= |
Change this to either a Django or 3rd party provided backend to use another Database type |
= OPTIONAL |
Required if using another database backend |
= |
For |
= OPTIONAL |
Probably required if using another database backend |
= OPTIONAL |
Required if using another database backend |
= OPTIONAL |
Probably required if using another database backend |
= |
Which device to use for plugins that support it. Currently allowed: cpu, cuda |
= OPTIONAL |
Add list of semi-colon |
= |
Whether to run the server in debug (true) or production (false) mode |
= |
Python |
= |
Password for the superuser to be created |
= |
Username for the superuser to be created |
= |
|
= |
Number of |
= |
Number of |
= |
Number of |
= |
Number of |
= |
If true, the server will attempt to update the main package to the version specified by |
= |
Path to the base directory of the project. If no other paths are configured using environment variables, the server database, plugin files and downloaded models will be stored here. |
= |
If true, all plugins will be disabled and not loaded at server start. Mostly used for testing purposes. |
= |
Address to bind the server to |
= |
Port the server will listen to |
= |
Number of gunicorn workers |
= |
Timeout for gunicorn workers |
= |
User to run the server as if using gunicorn. |
= |
true/false/path. If true, a logfile named |
= OPTIONAL |
<NAME> = [the package name] <VAR> = [VERSION|SCOPE|EXTRAS]. Override the version, scope or extras of a package to be installed/updated. EXAMPLE: |
= OPTIONAL |
Default set to the downloaded release version Version the |
= |
Allow setting of CORS headers in the server responses |
Plugin variable list
List of environment variables used by various plugins to configure their behavior. For more details visit the respective plugin documentation.
Variable (=[default]) |
Description |
---|---|
= |
Path to a directory where easyocr models will be downloaded and loaded from. |
= REQUIRED |
Endpoint URL for the Ollama API. |
= |
Prefix added to the model name, made customizable via environment variable since people might not want to setup a dedicated server for this. |
= |
Path to a directory where paddleocr models will be downloaded and loaded from. |
= |
If true, tesseract will attempt to download missing language models when needed. |
= OPTIONAL |
Path to a directory where tesseract models will be downloaded and loaded from. |
= |
Path to a directory where transformers models will be downloaded and loaded from. |
= |
If set to 1, transformers will not attempt to download models and will only use models already present in the storage cache. |
Utility run scripts
List of environment variables used in the run/run-user.[sh|bat]
scripts to configure their behavior.
Variable (=[default]) |
Description |
---|---|
= OPTIONAL |
Path to a pip installer script like |
= |
Python executable to use to run the script. Mostly used to choose the initial version with which to create the virtual environment. |
= |
If true, the script will not attempt to create/use a virtual environment and will run using the current python environment. |
= |
Path to the virtual environment directory to use/create. |
Docker environment variables
List of environment variables used by the start-server.sh
in docker.
Variable (=[default]) |
Description |
---|---|
= |
Group ID to run the server as inside the container. Mostly useful when mounting volumes to avoid permission issues. |
= |
User ID to run the server as inside the container. Mostly useful when mounting volumes to avoid permission issues. |
Docker exceptions
In Docker environments, the values of OCT_DJANGO_PORT
and OCT_BASE_DIR
are overridden and cannot be customized.
To persist data, bind mount the container path /plugin_data
. The server listens on port 4000
, which should be mapped to the desired host port.