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 strict 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 customers access the nLink dashboard and API. This is mandatory for SAML SSO workflows and OAuth callbacks to function correctly.CREDENTIAL_SECRET_KEY(CRITICAL): A 32-character secure 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, or existing credentials will be undecryptable.DATABASE_DEFAULT: Specifies the primary database engine the system should use. Accepted values areSQLITE,MYSQL, orPOSTGRES.MYSQL_HOST/POSTGRES_HOST: These variables define the internal DNS hostnames of your database containers. Because of Docker's internal networking, assigning=mysql_dbautomatically routes the connection to the container named `mysql_db`. You do not need to input `localhost` or an IP address.REDIS_ADDR: The complete address and port string for the Redis cache cluster (e.g.,redis_server:6379inside the docker network).NLINK_HEALING_OPENAI_KEY: Activates the AI Self-Healing Engine. Supply an OpenAI API key (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` isn't recommended for production setups. Instead, map these 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 adapt your compose file to interpolate them:
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}