장기 운영 관점 자체 점검에서 나온 6개 구멍 반영:
- 회차 추적: 모든 배치 라인에 [batch {run_id}] 태그 + 시작 로그(ISO 주차·force)
+ 상주 기동 시 다음 실행 예정 시각 출력
- 회사별 구분: 칸별 조정 상세(company= type= bracket= n= 성공= before‰→after‰
adj_id=)와 회사요약(테넌트당 1줄: 평가/상승/유지/하락/이월/실패/제외) —
grep company=<uuid> 로 테넌트 단위 추적, adj_id 로 DB 행 교차 확인
- 경보 연결: failed_cells>0 이면 종료 요약 WARNING 승격, Redis 실패는 연산별
처음 5건만 WARN 후 누계 요약(폭주 억제)
- 시간대: 로그 타임스탬프를 컨테이너 TZ 무관 KST(+0900) 고정, slim 컨테이너
zoneinfo 보장용 tzdata 의존 추가
- 스케줄 가시성: apscheduler 로거를 동일 핸들러에 연결(misfire 등 유실 방지)
- 로테이션: compose 에 json-file 10MB×5 설정(디스크 보호)
docs/개발용.md §8 로그 규약, README 로그 확인법 추가. 테스트에 로그 규약
검증(run_id 태그·조정 라인·회사요약) 포함 — 15 passed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
31 lines
959 B
YAML
31 lines
959 B
YAML
# anchoring 자립 서비스 — 루트 compose 와 독립(다른 서버를 건드리지 않음).
|
|
# DB 는 기존 외부 PostgreSQL(host.docker.internal), Redis 는 여기 동봉.
|
|
# negodata(견적 생성 측)는 이 redis 인스턴스를 REDIS_HOST 로 바라본다(docs/인수인계.md).
|
|
# 로그: stdout(json-file) — 로테이션 필수(장기 운영 디스크 보호). 로그 시각은 코드가 KST 로 고정.
|
|
x-logging: &default-logging
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "5"
|
|
|
|
services:
|
|
anchoring-redis:
|
|
image: redis:7-alpine
|
|
container_name: anchoring-redis
|
|
ports:
|
|
- "6379:6379"
|
|
restart: unless-stopped
|
|
logging: *default-logging
|
|
|
|
anchoring:
|
|
build: .
|
|
container_name: anchoring
|
|
environment:
|
|
DB_HOST: host.docker.internal
|
|
REDIS_HOST: anchoring-redis
|
|
TZ: Asia/Seoul
|
|
depends_on:
|
|
- anchoring-redis
|
|
restart: unless-stopped
|
|
logging: *default-logging
|