Initial commit: RIPE CIDR/FQDN collector

Collector daemon, FastAPI server (addresses, diff, collect, sources),
SQLite storage with change journal, Docker Compose deployment,
tests, documentation and project rules.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ayurishchevandClaude Sonnet 5 committed 2026-09-21 07:29:38 +03:00
commit bcf8156085
45 files changed
+3134

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
# API и сборщик - два независимых сервиса одного образа; общаются только файлами в томе /data
x-common: &common
build: .
image: ripe-cidr-collector
restart: unless-stopped
environment:
TZ: ${TZ:-UTC} # часовой пояс, в котором считаются cron-расписания
volumes:
- ripe_data:/data
read_only: true
tmpfs:
- /tmp
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
api:
<<: *common
ports:
- "${API_PORT:-8000}:8000"
env_file: .env # RIPE_API_TOKEN; без него изменяющие запросы отключены (503)
healthcheck:
test: ["CMD", "python", "healthcheck.py", "api"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
collector:
<<: *common
command: ["python", "collector_daemon.py"]
stop_grace_period: 60s # идущий сбор успевает завершиться по SIGTERM
healthcheck:
test: ["CMD", "python", "healthcheck.py", "collector"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
volumes:
ripe_data: