fix: remove env_file to prevent credential override, add .env.production template
This commit is contained in:
15
.env.production
Normal file
15
.env.production
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Database credentials (must match existing PostgreSQL volume)
|
||||||
|
DB_USER=bbdf554
|
||||||
|
DB_PASSWORD=Idk@2026lolhappyha232
|
||||||
|
DB_DATABASE=directus
|
||||||
|
|
||||||
|
# Admin credentials
|
||||||
|
ADMIN_EMAIL=somescreenname@gmail.com
|
||||||
|
ADMIN_PASSWORD=Idk@2026lolhappyha232
|
||||||
|
|
||||||
|
# Directus keys
|
||||||
|
KEY=9i2t1bMAIITWCZ+WrzUEk4EuNmIu3kfyB9Peysk7f/jnUZ7hzQ5HoNC8yOT5vi/rwTmDWX3a1+4j2llgAE2VvA==
|
||||||
|
SECRET=Mr4YSrOAfwToxCDFOPwUa8qtxd7BXOvmqXalk3ReikpfcIwf08Kp+hlNjGcr1NtcLIcIZoraaULnMefD5IukGA==
|
||||||
|
|
||||||
|
# Optional
|
||||||
|
DIRECTUS_ADMIN_TOKEN=
|
||||||
35
TROUBLESHOOTING.md
Normal file
35
TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Database Credentials Issue - Troubleshooting
|
||||||
|
|
||||||
|
## Problem
|
||||||
|
Directus is trying to connect with user `sparkuser` but the database has user `bbdf554`.
|
||||||
|
|
||||||
|
## Root Cause
|
||||||
|
Coolify might have environment variables that override the docker-compose.yaml values.
|
||||||
|
|
||||||
|
## Solution Options
|
||||||
|
|
||||||
|
### Option 1: Check Coolify Environment Variables
|
||||||
|
In Coolify UI → Application → Environment Variables:
|
||||||
|
- Look for `DB_USER` variable
|
||||||
|
- If it says `sparkuser`, delete it or change to `bbdf554`
|
||||||
|
|
||||||
|
### Option 2: Add .env file to override
|
||||||
|
Create a `.env` file in the repo with:
|
||||||
|
```
|
||||||
|
DB_USER=bbdf554
|
||||||
|
DB_PASSWORD=Idk@2026lolhappyha232
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 3: Hardcode in docker-compose (already done)
|
||||||
|
The docker-compose.yaml already has hardcoded values, but Coolify's `env_file: .env` might be overriding them.
|
||||||
|
|
||||||
|
## Current Status
|
||||||
|
- PostgreSQL: ✅ Running with user `bbdf554`
|
||||||
|
- Redis: ✅ Running
|
||||||
|
- Frontend: ✅ Running
|
||||||
|
- Directus: ❌ Can't connect (wrong username)
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
1. Check if Coolify has environment variable overrides
|
||||||
|
2. Remove any `DB_USER=sparkuser` variables
|
||||||
|
3. Redeploy
|
||||||
@@ -11,7 +11,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: Idk@2026lolhappyha232
|
POSTGRES_PASSWORD: Idk@2026lolhappyha232
|
||||||
POSTGRES_DB: directus
|
POSTGRES_DB: directus
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1"]
|
test: [ "CMD-SHELL", "pg_isready -h 127.0.0.1" ]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
@@ -23,7 +23,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- 'redis-data:/data'
|
- 'redis-data:/data'
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "ping"]
|
test: [ "CMD", "redis-cli", "ping" ]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
@@ -59,7 +59,7 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "--spider", "--no-verbose", "http://127.0.0.1:8055/server/health"]
|
test: [ "CMD", "wget", "--spider", "--no-verbose", "http://127.0.0.1:8055/server/health" ]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
@@ -92,3 +92,6 @@ volumes:
|
|||||||
redis-data:
|
redis-data:
|
||||||
directus-uploads:
|
directus-uploads:
|
||||||
directus-extensions:
|
directus-extensions:
|
||||||
|
|
||||||
|
# NOTE: No env_file specified - all credentials are hardcoded above
|
||||||
|
# This prevents Coolify from loading external .env files that might override values
|
||||||
|
|||||||
Reference in New Issue
Block a user