release: dev → main (финальная сдача) #114

Merged
Eleboba merged 12 commits from dev into main 2026-10-05 13:43:38 +03:00
7 changed files with 50 additions and 4 deletions
Showing only changes of commit 4b166cf488 - Show all commits
+1 -1
View File
@@ -6,7 +6,7 @@ install:
up:
@test -f .env || cp .env.example .env
docker compose up -d --build
@echo "API: http://localhost:8000/docs Dashboard: http://localhost:8501"
@echo "Patient app: http://localhost:8080 API: http://localhost:8000/docs Doctor/demo console: http://localhost:8501"
down:
docker compose down
+3 -3
View File
@@ -36,17 +36,17 @@
## 3. Развёртывание и запуск
**Требования:** Docker с Compose v2. Для локальной разработки — Python 3.12 и [uv](https://docs.astral.sh/uv/); для сборки веб-приложения — Node 20 (или docker-образ `node:20-alpine`).
**Требования:** только Docker с Compose v2 — всё остальное собирается в контейнерах. Для разработки — Python 3.12 и [uv](https://docs.astral.sh/uv/), Node 20.
```bash
cp .env.example .env # по умолчанию офлайн: LLM_PROVIDER=mock, агент выключен
make up # postgres + API (:8000) + кабинет врача и демо-консоль (:8501)
make up # postgres + API (:8000) + кабинет врача/демо-консоль (:8501) + приложение пациента (:8080)
make seed # синтетический кабинет: врач, ветеран Андрей и 7 пациентов
```
- API и Swagger: http://localhost:8000/docs
- Кабинет врача и демо-консоль: http://localhost:8501
- Веб-приложение пациента: `cd web && npm ci && npm run dev`, затем http://localhost:5173 (`/api` проксируется на :8000)
- Веб-приложение пациента: http://localhost:8080 (собирается внутри Docker, Node на машине не нужен; для разработки — `cd web && npm run dev`, :5173)
**Включить чат-агента** в `.env`:
- `CHAT_AGENT=gigachat` + `GIGACHAT_CREDENTIALS=…` — целевой вариант для РФ;
+9
View File
@@ -47,5 +47,14 @@ services:
ports:
- "8501:8501"
web:
# Patient web app (React) — built inside Docker, no Node needed on the host.
build: ./web
depends_on:
app:
condition: service_healthy
ports:
- "8080:80"
volumes:
pgdata:
+4
View File
@@ -28,3 +28,7 @@ services:
- "127.0.0.1:8511:8501"
restart: unless-stopped
mem_limit: 768m
web:
# On the server the host nginx serves the web bundle itself (deploy.sh builds web/dist).
profiles: ["local-only"]
+3
View File
@@ -0,0 +1,3 @@
node_modules
dist
.vite
+12
View File
@@ -0,0 +1,12 @@
# Patient web app: build with Node in a throwaway stage, serve the static bundle with nginx (+ /api → app).
# The jury only needs Docker: `make up` builds and starts it (http://localhost:8080).
FROM node:20-alpine AS build
WORKDIR /w
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . .
RUN npm run build
FROM nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /w/dist /usr/share/nginx/html
+18
View File
@@ -0,0 +1,18 @@
# Same-origin API: the app calls /api/v1/... — proxied to the FastAPI container (SSE streaming unbuffered).
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://app:8000;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_buffering off;
proxy_read_timeout 120s;
}
}