Set environment variables in the .env file in the project root directory. After modifying environment variables, you need to kill the application process and restart.
Modify the docker-compose.yml configuration and set environment variables in the environment parameter. Example:
You can also use env_file, which allows setting environment variables in the .env file. Example:
After modifying environment variables, you need to rebuild the app container.
Used to set the application's timezone, defaults to the operating system timezone.
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Operations related to time will be processed according to this timezone. Modifying TZ may affect date values in the database.
Application environment, default value development, options include:
production Production environmentdevelopment Development environmentWhen APP_ENV=production, if LOGGER_FORMAT is not set, defaults to json format. If LOGGER_LEVEL is not set, defaults to info level.
Application secret key, used to generate user tokens, etc. Change to your own application secret key and ensure it's not leaked
If APP_KEY is changed, old tokens will also become invalid
Application port, default value 3000
Tachybase API address prefix, default value /api/
Local storage path, default value storage/uploads
Plugin package name prefix, defaults to: @tachybase/plugin-,@tachybase/preset-,@tachybase/module-,@hera/plugin-,@hera/module-.
For example, adding a hello plugin to a my-tachybase-app project, the plugin's full package name would be @my-tachybase-app/plugin-hello.
PLUGIN_PACKAGE_PREFIX can be configured as:
Then plugin names and package names correspond as follows:
users plugin package name is @tachybase/module-userstachybase plugin package name is @tachybase/preset-tachybasehello plugin package name is @my-tachybase-app/plugin-helloDatabase type, default value sqlite, options include:
sqlitemariadbmysqlpostgresPostgres database is recommended, some databases may not be supported under specific plugins
Database file path (configured when using SQLite database)
Database host (needs to be configured when using MySQL or PostgreSQL database)
Default value localhost
Database port (needs to be configured when using MySQL or PostgreSQL database)
Database name (needs to be configured when using MySQL or PostgreSQL database)
Database user (needs to be configured when using MySQL or PostgreSQL database)
Database password (needs to be configured when using MySQL or PostgreSQL database)
Data table prefix
Whether database table names and field names are converted to snake case style, defaults to false. If using MySQL (MariaDB) database and lower_case_table_names=1, then DB_UNDERSCORED must be true
When DB_UNDERSCORED=true, the actual table names and field names in the database are not consistent with what you see in the interface, for example orderDetails in the database is order_details
Database logging switch, default value off, options include:
on Onoff OffLog output method, multiple values separated by ,. Development environment default value console, production environment default value console,dailyRotateFile.
Options:
console - console.logfile - FiledailyRotateFile - Daily rotating fileFile-based log storage path, defaults to storage/logs.
Output log level, development environment default value debug, production environment default value info. Options:
errorwarninfodebugtraceDatabase log output level is debug, controlled by DB_LOGGING whether to output, not affected by LOGGER_LEVEL.
Maximum number of log files to retain.
LOGGER_TRANSPORT is file, default value is 10.LOGGER_TRANSPORT is dailyRotateFile, use [n]d to represent days. Default value is 14d.Log rotation by size.
LOGGER_TRANSPORT is file, unit is byte, default value is 20971520 (20 * 1024 * 1024).LOGGER_TRANSPORT is dailyRotateFile, can use [n]k, [n]m, [n]g. No default configuration.Log print format, development environment default console, production environment default json. Options:
consolejsonlogfmtdelimiterUnique identifier for cache method, specifies server's default cache method, default value memory, built-in options:
memoryredisMaximum number of memory cache items, default value 2000.
Redis connection, optional. Example: redis://localhost:6379
Encryption key for encrypted fields, 32-character string, defaults to 12345678901234567890123456789012.
Number of worker processes, default value 1.
Maximum number of worker processes, default value 8. Currently, the number of threads controlled input on the web page cannot exceed this value.
Worker process transaction maximum timeout (seconds), default value 1800.
Worker process startup failure retry count, default value 5.
Sub-application worker process count, to prevent multiple sub-applications from occupying resources, default value 0.
Export table maximum length, default value 2000.
Page size for exporting tables using worker threads, default value 1000.
Enable/disable built-in plugins, default value is empty.
Add ! before name to remove specified plugin, add | before name to add specified plugin but disable by default
Enable/disable local plugins, default value is empty.
Add ! before name to remove specified plugin, add | before name to add specified plugin but disable by default
Force use of cached language packs, when enabled in local development environment can cache requests for getLang interface, returning 302 status code, not recommended to enable. Default value 0.
Temporary environment variables only take effect in specific situations (installation), do not affect runtime after installation
When installing tachybase, you can set temporary environment variables to assist installation, such as:
Language during installation, default value en-US, options include:
en-USzh-CNRoot user email
Root user password
Root user nickname