create-nocobase-app Installation MethodSet environment variables in the .env file in the project's root directory. After modifying the environment variables, kill the application process and restart it.
Modify the docker-compose.yml configuration and set the environment variables in the environment parameter. Example:
You can also use env_file to set environment variables in the .env file. Example:
After modifying the environment variables, rebuild the app container:
Used to set the application's time zone, with the default being the system's time zone.
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Time-related operations will be handled according to this time zone. Changing TZ may affect date values in the database. For more details, refer to Date & Time Overview.
Application environment, default is development, options include:
production production environmentdevelopment development environmentThe application's secret key, used for generating user tokens, etc. Change it to your own application key and ensure it is not leaked.
If APP_KEY is changed, old tokens will become invalid.
Application port, default is 13000.
NocoBase API address prefix, default is /api/.
v1.6.0+
The multi-core (cluster) mode for starting app. If this variable is configured, it will be passed to the pm2 start command as the -i <instances> parameter. The options are consistent with the pm2 -i parameter (refer to PM2: Cluster Mode), including:
max: Use the maximum number of CPU cores-1: Use the maximum number of CPU cores minus one<number>: Specify the number of coresThe default value is empty, meaning it is not enabled.
This mode requires the use of plugins related to cluster mode. Otherwise, the functionality of the application may encounter unexpected issues.
For more information, see Cluster Mode.
Plugin package prefix, default is @nocobase/plugin-,@nocobase/preset-.
For example, to add the hello plugin to the my-nocobase-app project, the plugin's full package name would be @my-nocobase-app/plugin-hello.
PLUGIN_PACKAGE_PREFIX can be configured as:
The correspondence between plugin name and package name is as follows:
users plugin package name is @nocobase/plugin-usersnocobase plugin package name is @nocobase/preset-nocobasehello plugin package name is @my-nocobase-app/plugin-helloDatabase type, options include:
mariadbmysqlpostgresDatabase host (required when using MySQL or PostgreSQL databases).
Default is localhost.
Database port (required when using MySQL or PostgreSQL databases).
Database name (required when using MySQL or PostgreSQL databases).
Database user (required when using MySQL or PostgreSQL databases).
Database password (required when using MySQL or PostgreSQL databases).
Data table prefix.
Whether database table and field names are converted to snake case style. Default is false. If using a MySQL (MariaDB) database with lower_case_table_names=1, then DB_UNDERSCORED must be set to true.
When DB_UNDERSCORED=true, the actual table and field names in the database will not match what is displayed in the UI. For example, orderDetails will be stored as order_details in the database.
Database log switch, default is off, options include:
on onoff offMaximum number of connections in the pool. Default is 5.
Minimum number of connections in the pool. Default is 0.
The maximum time, in milliseconds, that a connection can be idle before being released. Default is 10000 (10 seconds).
The maximum time, in milliseconds, that the pool will try to get a connection before throwing an error. Default is 60000 (60 seconds).
The time interval, in milliseconds, after which the connection pool will remove idle connections. Default is 1000 (1 second).
The number of times a connection can be used before it is discarded and replaced. Default is 0 (unlimited).
Log output method, multiple values separated by ,. Default is console in development, console,dailyRotateFile in production.
Options:
console - console.logfile - Output to a filedailyRotateFile - Output to daily rotating filesFile-based log storage path, default is storage/logs.
Output log level. Default is debug in development and info in production. Options:
errorwarninfodebugtraceThe database log output level is debug, controlled by DB_LOGGING, and is unaffected by LOGGER_LEVEL.
Maximum number of log files to keep.
LOGGER_TRANSPORT is file: Default is 10.LOGGER_TRANSPORT is dailyRotateFile: Use [n]d to represent days. Default is 14d.Log rotation by size.
LOGGER_TRANSPORT is file: Unit is byte. Default is 20971520 (20 * 1024 * 1024).LOGGER_TRANSPORT is dailyRotateFile: Use [n]k, [n]m, [n]g. Default is not set.Log print format. Default is console in development and json in production. Options:
consolejsonlogfmtdelimiterReference: Log Format
Unique identifier for the caching method, specifying the server's default cache. Default is memory. Built-in options include:
memoryredisMaximum number of items in the memory cache. Default is 2000.
Redis connection URL, optional. Example: redis://localhost:6379
Enable telemetry data collection. Default is off.
Enabled monitoring metric collectors. Default is console. Other values should refer to the names registered by corresponding collector plugins, such as prometheus. Multiple values are separated by ,.
Enabled trace data processors. Default is console. Other values should refer to the names registered by corresponding processor plugins. Multiple values are separated by ,.
Used to append preset local plugins. The value is the package name (the name parameter in package.json), with multiple plugins separated by commas.
:::info
node_modules directory. For more details, see Plugin Organization.nocobase install) or upgrade (nocobase upgrade).
:::Used to append built-in plugins that are installed by default. The value is the package name (the name parameter in package.json), with multiple plugins separated by commas.
:::info
node_modules directory. For more details, see Plugin Organization.nocobase install) or upgrade (nocobase upgrade).
:::The installation of NocoBase can be assisted by setting temporary environment variables, such as:
Language at the time of installation. Default is en-US. Options include:
en-USzh-CNRoot user email.
Root user password.
Root user nickname.