fixed .env
This commit is contained in:
+22
-3
@@ -1,6 +1,12 @@
|
||||
# Server
|
||||
PORT=8080
|
||||
# Server (internal bind inside containers)
|
||||
HOST=0.0.0.0
|
||||
BACKEND_INTERNAL_PORT=8080
|
||||
FRONTEND_INTERNAL_PORT=80
|
||||
|
||||
# External ports on the host (docker compose publish)
|
||||
BACKEND_PORT=8080
|
||||
FRONTEND_PORT=3080
|
||||
VITE_DEV_PORT=5173
|
||||
|
||||
# OpenRouter
|
||||
OPENROUTER_API_KEY=sk-or-v1-your-key-here
|
||||
@@ -9,5 +15,18 @@ OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
|
||||
|
||||
# App
|
||||
DATABASE_URL=sqlite:///./data/assistant.db
|
||||
CORS_ORIGINS=http://localhost:5173,http://localhost:8080,http://localhost:3000
|
||||
# Add your server URL with FRONTEND_PORT, e.g. http://grigosserver:3080
|
||||
CORS_ORIGINS=http://localhost:5173,http://localhost:8080,http://localhost:3080
|
||||
SYSTEM_PROMPT_PATH=./prompts/assistant.md
|
||||
|
||||
# External services (phase 2 — homelab integrations)
|
||||
TAIGA_BASE_URL=http://taiga:9000
|
||||
TAIGA_PORT=9000
|
||||
GITEA_BASE_URL=http://gitea:3000
|
||||
GITEA_PORT=3000
|
||||
GITEA_SSH_PORT=222
|
||||
REPOS_DIR=/data/repos
|
||||
|
||||
# Vector DB (phase 3)
|
||||
QDRANT_PORT=6333
|
||||
QDRANT_GRPC_PORT=6334
|
||||
|
||||
@@ -21,19 +21,34 @@ cp .env.example .env
|
||||
|
||||
```env
|
||||
OPENROUTER_API_KEY=sk-or-v1-...
|
||||
PORT=8080
|
||||
BACKEND_PORT=8080
|
||||
FRONTEND_PORT=3080
|
||||
```
|
||||
|
||||
Если порт занят (например, 3000 уже используется Gitea), смените `FRONTEND_PORT` на свободный.
|
||||
|
||||
### 2. Запуск через Docker
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
- Backend API: http://localhost:8080
|
||||
- Web UI: http://localhost:3000
|
||||
- Backend API: http://localhost:${BACKEND_PORT:-8080}
|
||||
- Web UI: http://localhost:${FRONTEND_PORT:-3080}
|
||||
- Healthcheck: http://localhost:8080/api/v1/health
|
||||
|
||||
Порты в `.env`:
|
||||
|
||||
| Переменная | По умолчанию | Назначение |
|
||||
|------------|--------------|------------|
|
||||
| `BACKEND_PORT` | 8080 | API с хоста |
|
||||
| `FRONTEND_PORT` | 3080 | Веб-морда с хоста |
|
||||
| `VITE_DEV_PORT` | 5173 | Frontend при `npm run dev` |
|
||||
| `TAIGA_PORT` | 9000 | Taiga (фаза 2) |
|
||||
| `GITEA_PORT` | 3000 | Gitea HTTP (фаза 2) |
|
||||
| `GITEA_SSH_PORT` | 222 | Gitea SSH (фаза 2) |
|
||||
| `QDRANT_PORT` | 6333 | Qdrant HTTP (фаза 3) |
|
||||
|
||||
### 3. Локальная разработка
|
||||
|
||||
**Backend:**
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ services:
|
||||
backend:
|
||||
build: ./backend
|
||||
ports:
|
||||
- "${PORT:-8080}:8080"
|
||||
- "${BACKEND_PORT:-8080}:${BACKEND_INTERNAL_PORT:-8080}"
|
||||
env_file: .env
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
args:
|
||||
VITE_API_URL: ""
|
||||
ports:
|
||||
- "3000:80"
|
||||
- "${FRONTEND_PORT:-3080}:${FRONTEND_INTERNAL_PORT:-80}"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user