diff --git a/.env.example b/.env.example index f56c1e8..5fb8b48 100644 --- a/.env.example +++ b/.env.example @@ -10,10 +10,13 @@ JWT_SECRET=your_very_long_random_jwt_secret_here # Database Configuration (PostgreSQL) DATABASE_CLIENT=pg DB_USER=picpeak +# IMPORTANT: Avoid $ character in passwords - Docker Compose interprets it as variable substitution +# If you must use $, escape it as $$ (e.g., Pass$$word instead of Pass$word) DB_PASSWORD=your_secure_postgres_password_here DB_NAME=picpeak_prod # Redis Configuration +# IMPORTANT: Same warning applies - avoid $ or escape as $$ REDIS_PASSWORD=your_secure_redis_password_here # Admin Account (initial setup) diff --git a/DEPLOYMENT_GUIDE.md b/DEPLOYMENT_GUIDE.md index 9251d33..6679985 100644 --- a/DEPLOYMENT_GUIDE.md +++ b/DEPLOYMENT_GUIDE.md @@ -58,13 +58,18 @@ Generate secure values: # JWT Secret openssl rand -base64 64 -# Database Password -openssl rand -base64 32 +# Database Password (avoid $ character - see warning below) +openssl rand -base64 32 | tr -d '$' -# Redis Password -openssl rand -base64 32 +# Redis Password (avoid $ character - see warning below) +openssl rand -base64 32 | tr -d '$' ``` +⚠️ **PASSWORD WARNING**: Docker Compose interprets `$` as variable substitution. Either: +- Avoid `$` in passwords (recommended - use the commands above) +- Escape `$` as `$$` (e.g., `Pass$$word` instead of `Pass$word`) +- Quote the entire value: `DB_PASSWORD='Pass$word'` (less reliable) + Update `.env` with: - `JWT_SECRET` - Authentication secret (REQUIRED - generate a secure random value) - `DB_PASSWORD` - PostgreSQL password @@ -432,6 +437,17 @@ FRONTEND_PORT=3002 BACKEND_PORT=3003 ``` +#### Docker Compose Variable Substitution Errors +If you see warnings like: +``` +WARN[0000] The "fgbf" variable is not set. Defaulting to a blank string. +``` + +This means your password contains `$` which Docker Compose interprets as a variable. Solutions: +1. **Best**: Generate passwords without `$`: `openssl rand -base64 32 | tr -d '$'` +2. **Alternative**: Escape `$` as `$$` in your .env file +3. **Example**: `DB_PASSWORD=Pass@#$$fgbf` instead of `DB_PASSWORD=Pass@#$fgbf` + #### Permission Errors ```bash # Fix ownership