- pyproject: Python 3.12, зависимости ADR-009, ruff/mypy strict/pytest/coverage - app/: точка входа-заглушка с graceful shutdown по SIGTERM - Dockerfile: multi-stage, uv, non-root (uid 10001), git+ssh для коммитов (#9); apt по HTTPS — в некоторых сетях обычный HTTP к deb.debian.org заблокирован - docker-compose: bot + postgres 16, healthcheck, лимиты памяти, ротация логов - Makefile: install/lint/fmt/test/cov/up/down/logs/ps; .env.example Refs #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
992 B
YAML
40 lines
992 B
YAML
# Local / any-host stack: `make up`. Server overrides — infra/deploy/docker-compose.server.yml (#12).
|
|
services:
|
|
bot:
|
|
build: .
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://tgit:${POSTGRES_PASSWORD:-tgit}@postgres:5432/tgit
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
mem_limit: 256m
|
|
labels:
|
|
tgit.managed: "true"
|
|
logging:
|
|
options: { max-size: "10m", max-file: "3" }
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: tgit
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tgit}
|
|
POSTGRES_DB: tgit
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U tgit -d tgit"]
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 20
|
|
restart: unless-stopped
|
|
mem_limit: 256m
|
|
labels:
|
|
tgit.managed: "true"
|
|
logging:
|
|
options: { max-size: "10m", max-file: "3" }
|
|
|
|
volumes:
|
|
pgdata:
|