Documentation
Environment Configuration
Configure the core variables that control how nLink's backend communicates with its dependencies.
Mapping Connection Strings
Inside the docker-compose.yml file, the `backend` service requires specific environment variables to discover databases within the isolated app-network bridge.
environment:
- BASE_FRONTEND_URL=http://localhost
- BASE_API_URL=http://localhost/api
- DATABASE_DEFAULT=SQLITE
- SQLITE_DATABASE=/app/storage/database.sqliteVariables Explained
BASE_FRONTEND_URL&BASE_API_URL(CRITICAL): Defines the public URLs where users access the nLink dashboard and API. These variables are mandatory for SAML SSO workflows and OAuth callbacks to function correctly.CREDENTIAL_SECRET_KEY(CRITICAL): A secure 32-character string used by the engine to perform AES-GCM encryption on all user credentials stored in the database. Do not lose or change this key after initialization, as existing credentials will become permanently inaccessible.DATABASE_DEFAULT: Specifies the primary database engine. Accepted values areSQLITE,MYSQL, orPOSTGRES.MYSQL_HOST/POSTGRES_HOST: These variables define the internal DNS hostnames of your database containers. Thanks to Docker's internal networking, assigning=mysql_dbautomatically routes the connection to the container named `mysql_db`. You do not need to use `localhost` or an IP address.REDIS_ADDR: The complete address and port string for the Redis cache cluster (e.g.,redis_server:6379within the Docker network).NLINK_HEALING_OPENAI_KEY: Activates the AI Self-Healing Engine. Supply an OpenAI API key (e.g.,sk-...) to allow the system to automatically repair data mapping errors and JSON structural changes from third-party APIs during execution.
Using a `.env` File
Hardcoding secret values inside `docker-compose.yml` is not recommended for production environments. Instead, map these variables dynamically using a .env file placed in the same directory:
# .env
BASE_FRONTEND_URL=https://app.yourdomain.com
BASE_API_URL=https://app.yourdomain.com/api
CREDENTIAL_SECRET_KEY=your_secure_32_char_random_string
DATABASE_DEFAULT=SQLITE
SQLITE_DATABASE=/app/storage/database.sqliteThen, update your Docker Compose file to interpolate these variables:
environment:
- BASE_FRONTEND_URL=${BASE_FRONTEND_URL}
- BASE_API_URL=${BASE_API_URL}
- CREDENTIAL_SECRET_KEY=${CREDENTIAL_SECRET_KEY}
- DATABASE_DEFAULT=${DATABASE_DEFAULT}
- SQLITE_DATABASE=${SQLITE_DATABASE}