2.7 KiB
2.7 KiB
Environment Variables Configuration
NocoDB Configuration (Required)
To fix API key issues and improve container deployment, set these environment variables in your Docker container:
Required Variables
# NocoDB Database Connection
NUXT_NOCODB_URL=https://database.monacousa.org
NUXT_NOCODB_TOKEN=your_actual_nocodb_api_token_here
NUXT_NOCODB_BASE_ID=your_nocodb_base_id_here
Alternative Variable Names (also supported)
# Alternative formats that also work
NOCODB_URL=https://database.monacousa.org
NOCODB_TOKEN=your_actual_nocodb_api_token_here
NOCODB_API_TOKEN=your_actual_nocodb_api_token_here
NOCODB_BASE_ID=your_nocodb_base_id_here
How to Set in Docker
Option 1: Docker Compose (Recommended)
Add to your docker-compose.yml:
services:
monacousa-portal:
image: your-image
environment:
- NUXT_NOCODB_URL=https://database.monacousa.org
- NUXT_NOCODB_TOKEN=your_actual_nocodb_api_token_here
- NUXT_NOCODB_BASE_ID=your_nocodb_base_id_here
# ... rest of your config
Option 2: Docker Run Command
docker run -d \
-e NUXT_NOCODB_URL=https://database.monacousa.org \
-e NUXT_NOCODB_TOKEN=your_actual_nocodb_api_token_here \
-e NUXT_NOCODB_BASE_ID=your_nocodb_base_id_here \
your-image
Option 3: Environment File
Create .env file:
NUXT_NOCODB_URL=https://database.monacousa.org
NUXT_NOCODB_TOKEN=your_actual_nocodb_api_token_here
NUXT_NOCODB_BASE_ID=your_nocodb_base_id_here
Then use:
docker run --env-file .env your-image
Priority Order
The system will check configuration in this order:
- Environment Variables (highest priority)
- Admin Panel Configuration (fallback)
- Runtime Config (last resort)
Benefits
✅ Container-Friendly: No need to configure through web UI ✅ Secure: API tokens stored as environment variables ✅ Reliable: No Unicode/formatting issues ✅ Version Control: Can be managed in deployment configs ✅ Scalable: Same config across multiple containers
Getting Your Values
NocoDB API Token
- Go to your NocoDB instance
- Click your profile → API Tokens
- Create new token or copy existing one
- Use the raw token without any formatting
NocoDB Base ID
- In NocoDB, go to your base
- Check the URL:
https://your-nocodb.com/dashboard/#/nc/base/BASE_ID_HERE - Copy the BASE_ID part
Testing Configuration
After setting environment variables, check the logs:
- ✅
[nocodb] ✅ Using environment variables - URL: https://database.monacousa.org - ✅
[nocodb] ✅ Configuration validated successfully
If you see fallback messages, the environment variables aren't being read correctly.