deployment/docker/.env
This file is gitignored - Your API key will NOT be committed to GitHub.
.env.example
This file IS committed to GitHub - Never put real API keys here!
Context/
│
├── .env.example ← Template (committed to GitHub)
│ └── GOOGLE_API_KEY= ← Empty placeholder
│
├── .gitignore ← Contains: .env, .env.*
│
└── deployment/docker/
└── .env ← Your actual secrets (gitignored)
└── GOOGLE_API_KEY=AIza... ← Your real API key goes here
.\scripts\setup_google_embeddings.ps1The script will:
- Create
deployment/docker/.envif it doesn't exist - Add your API key securely
- Verify it's gitignored
# 1. Create .env from template (if it doesn't exist)
Copy-Item ".env.example" "deployment/docker/.env"
# 2. Edit deployment/docker/.env and add:
EMBEDDINGS_PROVIDER=google
GOOGLE_API_KEY=AIza_your_actual_key_here
GOOGLE_EMBEDDING_MODEL=text-embedding-004
QDRANT_VECTOR_SIZE=768
# 3. Verify it's gitignored
git status
# Should NOT show deployment/docker/.envRun the verification script:
.\scripts\verify_env_security.ps1This will check:
- ✅
.gitignoreis properly configured - ✅
.envfiles are not tracked by git - ✅
.env.exampleis tracked (as a template) - ✅ Your actual
.envfile exists - ✅ Git status doesn't show
.envfiles
- Store API keys in
deployment/docker/.env - Keep
.env.exampleas a template with empty values - Add
.envto.gitignore(already done) - Use environment variables for all secrets
- Share
.env.examplewith your team - Document required variables in
.env.example
- Never commit
.envfiles to git - Never put real API keys in
.env.example - Never hardcode API keys in source code
- Never share
.envfiles publicly - Never commit files with
AIza...or other API keys
Your .gitignore already has:
.env
.env.*
!.env.exampleThis means:
- ✅ All
.envfiles are ignored - ✅
.env.exampleis tracked (template only) - ✅ Your API keys are safe
# Remove the file from git tracking
git rm --cached deployment/docker/.env
# Commit the removal
git commit -m "Remove .env from tracking"
# Push the change
git push- Go to: https://makersuite.google.com/app/apikey
- Delete the old API key
- Create a new API key
- Update
deployment/docker/.envwith the new key
.\scripts\verify_env_security.ps1Before committing code:
- Verified
.envis in.gitignore - Ran
git status- no.envfiles shown - Only
.env.exampleis tracked -
.env.examplehas no real API keys - Actual API key is in
deployment/docker/.env - Ran
.\scripts\verify_env_security.ps1
| File | Location | Committed? | Contains |
|---|---|---|---|
.env.example |
Root directory | ✅ Yes | Empty placeholders |
.env |
deployment/docker/ |
❌ No | Your actual API key |
Remember:
.env.example= Template (safe to commit).env= Secrets (never commit)
Run the verification script:
.\scripts\verify_env_security.ps1It will tell you exactly what's configured correctly and what needs fixing.
Your API key is safe as long as it's in deployment/docker/.env ✅