fix: production hardening — 5 critical issues resolved

1. Dockerfile: remove UTF-16 encoding conversion (requirements.txt now plain UTF-8)
   Add --forwarded-allow-ips=* to uvicorn so rate limiter + audit logs
   see real client IPs through nginx, not nginx container IP

2. .dockerignore: exclude pandoc MSI (~200MB), blog_images/, frontend-legacy/,
   *.md docs, *.docx, *.msi, *.patch, openrouter_error.log — significant image
   size reduction

3. requirements.txt: convert from UTF-16 to plain UTF-8 (removes need for
   Dockerfile encoding hack), pypdf==4.3.1 already added in previous commit

4. DEPLOYMENT.md: add missing frontend build step (npm install && npm run build),
   add database migration commands (migrate.py + v003 + v004 SQL files),
   add super admin creation step, add HTTPS setup, add backup command,
   add troubleshooting table

5. All secrets now come from .env only (no fallback defaults in docker-compose)
This commit is contained in:
Atharv1705
2026-08-10 10:42:37 +05:30
parent aff470bb48
commit 419aa6de3d
4 changed files with 223 additions and 32 deletions
+38 -2
View File
@@ -1,16 +1,52 @@
# Git and IDE
.git
.github
.vscode
# Python
__pycache__
*.pyc
*.pyo
*.pyd
*.log
.env*
.venv
venv
# Node
node_modules
frontend/.vite
# Environment — never bake secrets into the image
.env*
# Test / cache artifacts
.pytest_cache
.mypy_cache
.ruff_cache
services/api/temp
uploads
# User uploads — stored in a named Docker volume, not in the image
uploads
# Legacy frontend (not used by the React app)
frontend-legacy
# Docs and blog content — not needed at runtime
blog_images
*.md
*.docx
*.patch
*.msi
AI_ENGINEERING_ONE_PAGER.md
COMPREHENSIVE_REVIEW.md
DEPLOYMENT.md
PROJECT_AUDIT.md
# Dev/utility scripts
check_docs.py
changes_from_last_commit.patch
openrouter_error.log
# Windows / macOS artifacts
Thumbs.db
.DS_Store