Files

128 lines
6.4 KiB
HTML

<h2>Секция 5: Деплой и технологический стек</h2>
<p class="subtitle">Развёртывание на сервере 78.153.7.224</p>
<div class="mockup">
<div class="mockup-header">Docker Compose — контейнеры на сервере</div>
<div class="mockup-body" style="padding: 24px; font-size: 13px;">
<div style="background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; margin-bottom: 16px;">
<div style="font-weight: bold; color: #60a5fa; margin-bottom: 12px;">🖥️ Сервер 78.153.7.224 — i9-10900 / 32GB RAM / RTX 3070 Ti</div>
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #3b82f6; flex: 1; min-width: 140px;">
<strong style="color: #60a5fa;">app</strong><br>
<small>FastAPI + Uvicorn<br>API + Web serving<br>Port 8000</small>
</div>
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #f59e0b; flex: 1; min-width: 140px;">
<strong style="color: #fbbf24;">worker</strong><br>
<small>Celery worker<br>Whisper (GPU)<br>LLM вызовы</small>
</div>
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #8b5cf6; flex: 1; min-width: 140px;">
<strong style="color: #a78bfa;">beat</strong><br>
<small>Celery beat<br>Автоочистка<br>Scheduled tasks</small>
</div>
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #dc2626; flex: 1; min-width: 140px;">
<strong style="color: #f87171;">redis</strong><br>
<small>Redis 7<br>Брокер задач<br>Кэш</small>
</div>
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #2563eb; flex: 1; min-width: 140px;">
<strong style="color: #60a5fa;">db</strong><br>
<small>PostgreSQL 16<br>Данные<br>Port 5432</small>
</div>
<div style="background: #334155; padding: 10px; border-radius: 6px; border-top: 3px solid #10b981; flex: 1; min-width: 140px;">
<strong style="color: #34d399;">nginx</strong><br>
<small>Reverse proxy<br>Static files<br>Port 80/443</small>
</div>
</div>
</div>
</div>
</div>
<div class="section" style="margin-top: 24px;">
<h3>Полный стек технологий</h3>
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #3b82f6;">Backend</strong><br>
Python 3.11+<br>
FastAPI + Uvicorn<br>
Celery + Redis<br>
SQLAlchemy + Alembic<br>
Pydantic v2
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #f59e0b;">AI / ML</strong><br>
Whisper large-v3 (faster-whisper)<br>
CUDA 12 + cuDNN<br>
FFmpeg (извлечение аудио)<br>
LiteLLM (unified LLM API)<br>
OpenRouter / Groq / платные
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #10b981;">Frontend</strong><br>
React + TypeScript<br>
Vite (сборка)<br>
Tailwind CSS<br>
React Query (API)<br>
React Router
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #8b5cf6;">Мессенджеры</strong><br>
aiogram 3.x (Telegram)<br>
Lensa SDK/webhook<br>
Общий MessengerService
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #dc2626;">Экспорт</strong><br>
python-docx (DOCX)<br>
WeasyPrint (PDF)<br>
Jinja2 (шаблоны)
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.8;">
<strong style="color: #6b7280;">Инфра</strong><br>
Docker + Docker Compose<br>
NVIDIA Container Toolkit<br>
Nginx (reverse proxy)<br>
Gitea (http://78.153.7.224:3000)<br>
Alembic (миграции БД)
</div>
</div>
</div>
<div class="section" style="margin-top: 24px;">
<h3>Распределение ресурсов сервера</h3>
<div style="background: #fefce8; border: 1px solid #fde047; border-radius: 8px; padding: 16px; font-size: 13px; line-height: 1.8;">
<ul style="margin: 0;">
<li><strong>GPU (8 GB VRAM)</strong> — целиком для Whisper (faster-whisper загружает модель ~3 GB, остальное — буфер обработки)</li>
<li><strong>RAM (32 GB)</strong> — ~4 GB PostgreSQL, ~2 GB Redis, ~4 GB FastAPI + workers, ~8 GB Whisper worker, остальное — ОС и запас</li>
<li><strong>CPU (i9-10900, 10 ядер)</strong> — хватит для параллельной обработки API + воркеры</li>
<li><strong>SSD 1 TB</strong> — ОС, Docker, БД, активные файлы</li>
<li><strong>HDD 1 TB</strong> — архивное хранение старых записей (перемещение по retention policy)</li>
</ul>
</div>
</div>
<div class="section" style="margin-top: 24px;">
<h3>CI/CD</h3>
<div style="background: #f1f5f9; padding: 16px; border-radius: 8px; font-size: 13px; line-height: 1.8;">
<ul style="margin: 0;">
<li>Код хранится в <strong>Gitea</strong> на http://78.153.7.224:3000</li>
<li>Деплой — <code>docker compose up -d --build</code> на сервере (ручной или через Gitea webhook)</li>
<li>Миграции БД — <code>alembic upgrade head</code> при старте контейнера app</li>
</ul>
</div>
</div>