feat: add production configuration with environment variables

- Add .env file for production deployment with reverse proxy
- Add docker-compose.prod.yml for production profile
- Add docker-compose.override.yml for local development
- Update docker-compose.yml with all configurable variables
- Update frontend to use VITE_* environment variables
- Update backend to support CORS_ORIGINS and WEBHOOK_BASE_URL
- Add vite.config.ts allowedHosts for reverse proxy
- Add documentation for docker-compose and reverse proxy setup

All URLs are now configurable via environment variables:
- VITE_API_URL: Backend API endpoint
- VITE_WEBHOOK_BASE_URL: Webhook base URL
- VITE_INSTALL_SCRIPT_URL: Install script URL
- VITE_APP_URL: Frontend URL
- CORS_ORIGINS: Allowed CORS origins
- WEBHOOK_BASE_URL: Backend webhook base URL
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-03 18:49:53 +02:00
parent 92217897ca
commit 26879acba4
12 changed files with 607 additions and 39 deletions

View File

@@ -1,22 +1,64 @@
# LogWhispererAI - Environment Variables
# ============================================
# FRONTEND CONFIGURATION (VITE_* variables)
# These are exposed to the browser
# ============================================
# Backend API URL - where the frontend will make API calls
# Example: https://srv-logwhispererai.lab.home.lucasacchi.net
VITE_API_URL=http://localhost:3001
# Webhook base URL - used for displaying webhook URLs to users
# Example: https://logwhispererai.lab.home.lucasacchi.net/webhook
VITE_WEBHOOK_BASE_URL=http://localhost:3001/webhook
# Install script URL - the curl command shown to users
# Example: https://logwhispererai.lab.home.lucasacchi.net/install.sh
VITE_INSTALL_SCRIPT_URL=http://localhost:3001/install.sh
# Application identification
VITE_APP_NAME=LogWhispererAI
VITE_APP_URL=http://localhost:5173
# ============================================
# BACKEND CONFIGURATION
# ============================================
# CORS Origins - comma-separated list of allowed frontend origins
# Use '*' for development, set specific domains for production
# Example: https://logwhispererai.lab.home.lucasacchi.net
CORS_ORIGINS=*
# Webhook base URL - used for generating webhook URLs
# Example: https://logwhispererai.lab.home.lucasacchi.net/webhook
WEBHOOK_BASE_URL=https://logwhisperer.ai/webhook
# API delay simulation (milliseconds)
DELAY_MS=1500
# Node environment
NODE_ENV=development
# ============================================
# OPTIONAL: Third-party Services
# ============================================
# Telegram Bot Configuration
# Ottieni questi valori seguendo le istruzioni in docs/telegram_setup.md
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
# TELEGRAM_BOT_TOKEN=your_bot_token_here
# TELEGRAM_CHAT_ID=your_chat_id_here
# n8n Configuration
N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/logwhisperer
# N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/logwhisperer
# AI Provider Configuration
OPENAI_API_KEY=your_openai_api_key_here
# oppure
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# OPENAI_API_KEY=your_openai_api_key_here
# ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Supabase Configuration (per autenticazione e database)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_anon_key_here
# SUPABASE_URL=https://your-project.supabase.co
# SUPABASE_ANON_KEY=your_anon_key_here
# Stripe Configuration (per pagamenti)
STRIPE_SECRET_KEY=sk_test_your_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
# STRIPE_SECRET_KEY=sk_test_your_key_here
# STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here