feat(phase-6): Complete testing and deployment setup

Testing:
- Add pytest configuration (pytest.ini)
- Add test fixtures (tests/conftest.py)
- Add ContentGenerator tests (13 tests)
- Add ContentScheduler tests (16 tests)
- Add PublisherManager tests (16 tests)
- All 45 tests passing

Production Docker:
- Add docker-compose.prod.yml with healthchecks, resource limits
- Add Dockerfile.prod with multi-stage build, non-root user
- Add nginx.prod.conf with SSL, rate limiting, security headers
- Add .env.prod.example template

Maintenance Scripts:
- Add backup.sh for database and media backups
- Add restore.sh for database restoration
- Add cleanup.sh for log rotation and Docker cleanup
- Add healthcheck.sh with Telegram alerts

Documentation:
- Add DEPLOY.md with complete deployment guide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 02:12:34 +00:00
parent 354270be98
commit 85bda6abcf
15 changed files with 2296 additions and 0 deletions

73
.env.prod.example Normal file
View File

@@ -0,0 +1,73 @@
# ===========================================
# Production Environment Variables
# Copy to .env.prod and fill in values
# ===========================================
# ─────────────────────────────────────────
# DATABASE
# ─────────────────────────────────────────
POSTGRES_USER=social_automation
POSTGRES_PASSWORD=CHANGE_THIS_STRONG_PASSWORD
POSTGRES_DB=social_automation
# ─────────────────────────────────────────
# APPLICATION
# ─────────────────────────────────────────
SECRET_KEY=GENERATE_A_SECURE_RANDOM_KEY_HERE
ENVIRONMENT=production
# ─────────────────────────────────────────
# BUSINESS INFO
# ─────────────────────────────────────────
BUSINESS_NAME="Consultoría AS"
BUSINESS_LOCATION="Tijuana, México"
BUSINESS_WEBSITE="https://consultoria-as.com"
CONTENT_TONE="Profesional pero accesible, técnico cuando es necesario"
# ─────────────────────────────────────────
# DEEPSEEK API
# ─────────────────────────────────────────
DEEPSEEK_API_KEY=your_deepseek_api_key
DEEPSEEK_BASE_URL=https://api.deepseek.com
# ─────────────────────────────────────────
# X (TWITTER) API
# ─────────────────────────────────────────
X_API_KEY=your_x_api_key
X_API_SECRET=your_x_api_secret
X_ACCESS_TOKEN=your_x_access_token
X_ACCESS_SECRET=your_x_access_secret
X_BEARER_TOKEN=your_x_bearer_token
# ─────────────────────────────────────────
# META (FACEBOOK, INSTAGRAM, THREADS)
# ─────────────────────────────────────────
META_ACCESS_TOKEN=your_meta_access_token
META_APP_ID=your_meta_app_id
META_APP_SECRET=your_meta_app_secret
# Facebook
FACEBOOK_PAGE_ID=your_facebook_page_id
# Instagram
INSTAGRAM_ACCOUNT_ID=your_instagram_account_id
# Threads
THREADS_USER_ID=your_threads_user_id
# ─────────────────────────────────────────
# IMAGE UPLOAD (ImgBB)
# ─────────────────────────────────────────
IMGBB_API_KEY=your_imgbb_api_key
# ─────────────────────────────────────────
# TELEGRAM NOTIFICATIONS
# ─────────────────────────────────────────
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
# ─────────────────────────────────────────
# FLOWER (Celery Monitor)
# ─────────────────────────────────────────
FLOWER_USER=admin
FLOWER_PASSWORD=CHANGE_THIS_STRONG_PASSWORD