accounting_automation: этап 1 бухгалтерской автоматизации (инвойсы из почты, категоризация, ручной разбор, MCP), интервальные задания scheduler, миграции 033/034/038
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
33
deploy/compose.accounting_automation.tmpl.yaml
Normal file
33
deploy/compose.accounting_automation.tmpl.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: __SERVICE__
|
||||
services:
|
||||
app:
|
||||
image: khb-microservices:${IMAGE_TAG}
|
||||
container_name: __SERVICE__
|
||||
restart: unless-stopped
|
||||
command: ["node", "packages/__PACKAGE__/dist/main.js"]
|
||||
user: "1000:1000"
|
||||
mem_limit: 4g
|
||||
environment:
|
||||
HOME: /home/deploy
|
||||
volumes:
|
||||
- /y/services/khb-config/settings.json5:/config/settings.json5:ro
|
||||
# вход claude.ai и сессии агентов лежат в домашней папке пользователя deploy
|
||||
- /home/deploy:/home/deploy
|
||||
- /y/services/khb-agents:/data/agents
|
||||
ports:
|
||||
- "127.0.0.1:__PORT__:__PORT__"
|
||||
networks: [khb-net, supabase_default]
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:__PORT__/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
logging:
|
||||
driver: json-file
|
||||
options: { max-size: "10m", max-file: "5" }
|
||||
networks:
|
||||
khb-net:
|
||||
external: true
|
||||
supabase_default:
|
||||
external: true
|
||||
@@ -8,7 +8,7 @@ TAG="${1:?usage: deploy.sh <image_tag>}"
|
||||
ROOT=/y/services
|
||||
IMAGE="khb-microservices:${TAG}"
|
||||
# имя сервиса : пакет : порт
|
||||
SERVICES=("khb-data-collector:data_collector:8084" "khb-assistant-prep:khbuild_assistant_prep:8085" "khb-scheduler:scheduler:8083" "khb-process-viz:khbuild_process_viz:8086" "khb-reports:reports:8087" "khb-employee-reports:employee_reports:8091" "khb-passwords-backupper:passwords_backupper:8093" "khb-todo-service:todo_service:8094" "khb-qbo-auth:qbo_auth:8095")
|
||||
SERVICES=("khb-data-collector:data_collector:8084" "khb-assistant-prep:khbuild_assistant_prep:8085" "khb-scheduler:scheduler:8083" "khb-process-viz:khbuild_process_viz:8086" "khb-reports:reports:8087" "khb-employee-reports:employee_reports:8091" "khb-passwords-backupper:passwords_backupper:8093" "khb-todo-service:todo_service:8094" "khb-qbo-auth:qbo_auth:8095" "khb-accounting:accounting_automation:8096")
|
||||
|
||||
docker image inspect "$IMAGE" >/dev/null
|
||||
docker network inspect khb-net >/dev/null 2>&1 || docker network create khb-net >/dev/null
|
||||
|
||||
@@ -61,5 +61,25 @@ server {
|
||||
proxy_read_timeout 30;
|
||||
}
|
||||
|
||||
# --- accounting_automation (khb-accounting, 127.0.0.1:8096): MCP для Claude сотрудников (разбор очереди бухгалтерии); внутренний REST наружу не открыт
|
||||
location = /api/acc/mcp {
|
||||
rewrite ^/api/acc/(.*)$ /$1 break;
|
||||
proxy_pass http://127.0.0.1:8096;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Authorization $http_authorization;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_read_timeout 120;
|
||||
}
|
||||
location = /api/acc/.well-known/oauth-protected-resource {
|
||||
proxy_pass http://127.0.0.1:8096/.well-known/oauth-protected-resource;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
location = /.well-known/oauth-protected-resource/api/acc/mcp {
|
||||
proxy_pass http://127.0.0.1:8096/.well-known/oauth-protected-resource;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location / { return 404; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user