docs: README по требованиям к оформлению и демо-сервисы examples/ (#19)
CI / ruff · mypy · pytest (pull_request) Successful in 26m33s
CI / ruff · mypy · pytest (pull_request) Successful in 26m33s
- README: цели и задачи, что реализовано, развёртывание (локально за 5 минут и полный стек), переменные, команды и данные, используемые API, ограничения и лимиты, что не сделано, структура репозитория - examples/: hello (healthy + материал для grep/агента), crash (💥 и 🔁), cpu_hog (🔥), unhealthy (🩺), syntax_error/lint_fail для коммита, вопросы агенту и атаки; make demo-up / demo-down в том же Compose-проекте - make local-proxy: read-only Docker API для `make run` - ARCHITECTURE: краш при restart-политике и гистерезис алертов Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Demo services next to the bot — the same Compose project, so the bot sees them on its network:
|
||||
# make demo-up (= docker compose -f docker-compose.yml -f examples/docker-compose.yml up -d)
|
||||
# make demo-down
|
||||
# The label tgit.managed=true is what makes them appear in «🩺 Статус», «📜 Логи» and alerts.
|
||||
x-demo: &demo
|
||||
image: python:3.12-slim
|
||||
working_dir: /demo
|
||||
volumes:
|
||||
- ./examples:/demo:ro
|
||||
environment:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
mem_limit: 64m
|
||||
logging:
|
||||
options: { max-size: "5m", max-file: "2" }
|
||||
|
||||
services:
|
||||
demo-hello:
|
||||
<<: *demo
|
||||
command: ["python", "hello_service.py"]
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
labels:
|
||||
tgit.managed: "true"
|
||||
tgit.health_url: http://demo-hello:8000/health
|
||||
|
||||
demo-crash:
|
||||
<<: *demo
|
||||
command: ["python", "crash.py"]
|
||||
restart: on-failure
|
||||
labels:
|
||||
tgit.managed: "true"
|
||||
|
||||
demo-cpu-hog:
|
||||
<<: *demo
|
||||
command: ["python", "cpu_hog.py"]
|
||||
restart: unless-stopped
|
||||
cpus: 1.0
|
||||
labels:
|
||||
tgit.managed: "true"
|
||||
|
||||
demo-unhealthy:
|
||||
<<: *demo
|
||||
command: ["python", "unhealthy.py"]
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "false"]
|
||||
interval: 10s
|
||||
retries: 2
|
||||
start_period: 5s
|
||||
labels:
|
||||
tgit.managed: "true"
|
||||
Reference in New Issue
Block a user