chore(deployment): add docker-compose and nginx setup for production

- Added Dockerfile and nginx.conf for frontend production build.
- Added docker-compose.yml to orchestrate backend and frontend.
- Updated geminiService.ts to support relative API paths via Nginx proxy.
- Updated documentation with deployment instructions for Synology/Docker.
This commit is contained in:
2025-12-22 16:14:08 +00:00
parent a077c48573
commit a850b055aa
5 changed files with 133 additions and 2 deletions

View File

@@ -3,8 +3,12 @@ import { LeadStatus, AnalysisResult, Competitor, Language, Tier, EmailDraft, Sea
// const apiKey = process.env.API_KEY; // Nicht mehr direkt im Frontend verwendet
// const ai = new GoogleGenAI({ apiKey: apiKey || '' }); // Nicht mehr direkt im Frontend verwendet
// URL unserer lokalen Node.js API-Brücke
const API_BASE_URL = `http://${window.location.hostname}:3001/api`;
// URL Konfiguration:
// Im Production-Build (Docker/Nginx) nutzen wir den relativen Pfad '/api', da Nginx als Reverse Proxy fungiert.
// Im Development-Modus (lokal) greifen wir direkt auf den Port 3001 zu.
const API_BASE_URL = import.meta.env.PROD
? '/api'
: `http://${window.location.hostname}:3001/api`;
// Helper to extract JSON (kann ggf. entfernt werden, wenn das Backend immer sauberes JSON liefert)
const extractJson = (text: string): any => {