dzen.nstarikov.ru/dzen-assistant/DEPLOY.md

88 lines
1.5 KiB
Markdown
Raw Normal View History

2026-06-27 14:07:10 +03:00
# Deploy to nstarikov server
Target path:
```bash
/var/www/dzen.nstarikov.ru
```
## 1. Copy project
```bash
mkdir -p /var/www/dzen.nstarikov.ru
cd /var/www/dzen.nstarikov.ru
```
Copy the contents of this `dzen-assistant` directory there.
## 2. Configure environment
```bash
cp .env.example .env
nano .env
```
Important values:
```env
PUBLIC_BASE_URL=https://dzen.nstarikov.ru
WHISPER_COMMAND=
YTDLP_COOKIES_PATH=/app/data/cookies.txt
```
If VK requires an authenticated download, put cookies here:
```bash
/var/www/dzen.nstarikov.ru/data/cookies.txt
```
## 3. Caddy
Add to the existing Caddyfile:
```caddyfile
dzen.nstarikov.ru {
reverse_proxy dzen-assistant-api:8000
}
```
Safer variant for production:
```caddyfile
dzen.nstarikov.ru {
@admin path /admin* /api*
basic_auth @admin {
admin REPLACE_WITH_CADDY_HASHED_PASSWORD
}
reverse_proxy dzen-assistant-api:8000
}
```
Make sure the app joins the external Docker network named `caddy`.
## 4. Start
```bash
docker compose up -d --build
```
## 5. Check
```bash
curl -i https://dzen.nstarikov.ru/health
curl -i https://dzen.nstarikov.ru/feed
```
Admin:
```text
https://dzen.nstarikov.ru/admin
```
## Notes
- Keep `worker` concurrency at `1` while Whisper/LLM processing is local.
- The first MVP can draft article stubs even before Whisper is wired. Add transcription and LLM generation after the RSS import test passes.
- Admin protection should be added through Caddy basic auth, VPN, or a separate protected admin subdomain before exposing it publicly.