Environment Variable Configuration
Reference guide for environment variables used by Genbase Engine and Studio.
Environment Variable Configuration
Genbase uses environment variables extensively for configuration. These variables control database connections, API keys for external services, authentication settings, and operational parameters.
Configuration Files
Environment variables are typically managed using .env
files:
- Root
.env
: Located at the repository root. Primarily used by Docker Compose to set environment variables for the containers. engine/.env
: Located in theengine/
directory. Read directly by the Engine application (FastAPI). Contains database URLs, API keys, auth secrets, etc.studio/.env
: Located in thestudio/
directory. Primarily used for build-time arguments for the Studio Docker image (likeVITE_ENGINE_URL
) and potentially runtime configuration read by the frontend application.
Priority and Overrides
When using Docker Compose, variables set directly in the docker-compose.yml
environment:
section or passed via the command line might override values from the .env
files. For local development (run-local.sh
), the .env
files in the respective service directories (engine/
, studio/
) are typically used.
Variable Reference
Here is a breakdown of common environment variables used by Genbase:
Configuration Priority
- Environment Variables: Variables set directly in the runtime environment (e.g., via
export
or Docker Composeenvironment:
section) usually take the highest priority. .env
Files: Variables loaded from.env
files are typically loaded next.- Default Values: Code defaults are used if no value is provided via environment or
.env
.
Always refer to the .env.template
files in the repository root, engine/
, and studio/
directories for the most up-to-date list of expected variables.