# Coolify Environment Variables Setup ## Issue: Category Pages 404 Error **Root Cause:** DATABASE_URL environment variable not set in Coolify deployment ## Solution ### Set Environment Variable in Coolify 1. Go to Coolify dashboard: https://coolify.qikbite.asia 2. Navigate to Applications → burmddit 3. Go to "Environment Variables" tab 4. Add the following variable: ``` Name: DATABASE_URL Value: postgres://burmddit:Burmddit2026@172.26.13.68:5432/burmddit ``` 5. Save and redeploy ### Alternative: Via Coolify API ```bash curl -X POST \ https://coolify.qikbite.asia/api/v1/applications/ocoock0oskc4cs00o0koo0c8/envs \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "key": "DATABASE_URL", "value": "postgres://burmddit:Burmddit2026@172.26.13.68:5432/burmddit", "is_build_time": false, "is_preview": false }' ``` ## Dockerfile Changes Made Updated `/Dockerfile` to accept DATABASE_URL at runtime: ```dockerfile # Production image FROM base AS runner WORKDIR /app ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 # Database URL will be provided at runtime by Coolify ARG DATABASE_URL ENV DATABASE_URL=${DATABASE_URL} ``` ## Testing After Fix Once environment variable is set and redeployed: ```bash # Test category pages curl https://burmddit.com/category/ai-news curl https://burmddit.com/category/tutorials curl https://burmddit.com/category/tips-tricks curl https://burmddit.com/category/upcoming ``` Should return HTML content with articles, not 404. ## Files Modified 1. ✅ `/Dockerfile` - Added runtime DATABASE_URL 2. ✅ `/frontend/.env.example` - Documented required env vars 3. ✅ `/COOLIFY-ENV-SETUP.md` - This file ## Next Steps 1. **Boss:** Set DATABASE_URL in Coolify (manual step - requires Coolify UI access) 2. **Modo:** Push changes and trigger redeploy 3. **Verify:** Test category pages after deployment --- **Status:** ⏳ Waiting for environment variable to be set in Coolify **ETA:** ~5 minutes after env var is set and redeployed