- APScheduler 크론(KST 5분): 마감일 지난 견적 / 모든 세션 종결 견적 → close_and_decide
- 마감 판정: 단독 최저가 낙찰 확정 / 동가·전원미참여 다음 라운드 재생성 / 거부·한도 마감
- 재생성: 같은 견적번호 체인(round+1, 이름 '(N차)'), 공급사 수로 재협상·재견적, 사유별 한도(미참여1+동가1)
- 수동 재생성 POST /regenerate/{qt_id} (마지막 차수만 허용)
- CloseOutcome enum + 잡 결과별 로그
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
80 lines
3.3 KiB
YAML
80 lines
3.3 KiB
YAML
# Negosium + Negodata 백엔드.
|
|
# DB 는 compose 에서 관리하지 않는다 — 각 backend 는 config.docker.toml 의 접속 정보대로
|
|
# 외부 PostgreSQL 에 연결한다(호스트에 떠 있는 로컬 postgres, 또는 따로 실행 중인 docker postgres).
|
|
# 컨테이너에서 호스트의 DB 에 접속할 때는 host.docker.internal 을 쓴다.
|
|
#
|
|
# docker compose up -d
|
|
# negosium 서버: http://localhost:9300/docs
|
|
# negosium 프론트: http://localhost:3300
|
|
# negodata 서버: http://localhost:9400/docs
|
|
# agent 서버: http://localhost:9500/docs
|
|
#
|
|
# DB 준비(최초 1회): postgres-init 의 SQL 을 대상 DB 에 적용한다.
|
|
# psql -h <host> -p <port> -U <user> -f postgres-init/01-schema.sql (단일 negosium_db + 도메인별 schema)
|
|
# psql -h <host> -p <port> -U <user> -f postgres-init/02-learning-schema.sql (agent learning 스키마)
|
|
# psql -h <host> -p <port> -U <user> -f postgres-init/03-seed-negodata.sql (negodata 전용 시드: admin / admin1234, company.users)
|
|
|
|
services:
|
|
negosium-backend:
|
|
build: ./backend
|
|
container_name: negosium-backend
|
|
environment:
|
|
APP_ENV: local
|
|
DB_HOST: host.docker.internal # 컨테이너→호스트 DB (config.local.toml의 127.0.0.1 override)
|
|
AGENT_BASE_URL: http://host.docker.internal:9500 # 컨테이너→호스트 agent (로컬 uvicorn :9500)
|
|
ports:
|
|
- "9300:9300"
|
|
# 컨테이너에서 호스트의 DB 로 접근 (config.docker.toml 의 host.docker.internal)
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
restart: unless-stopped
|
|
|
|
negodata-backend:
|
|
build: ./negodata/backend
|
|
container_name: negodata-backend
|
|
environment:
|
|
APP_ENV: local
|
|
DB_HOST: host.docker.internal # 컨테이너→호스트 DB (config.local.toml의 127.0.0.1 override)
|
|
RELOAD: "1" # uvicorn --reload 활성 → 소스 저장 시 자동 재기동(재빌드 불필요)
|
|
SCHEDULER_ENABLED: "1" # 마감 크론 활성(단일 워커라 중복 없음). 운영 다중 워커면 1개 프로세스에서만 1
|
|
PYTHONUNBUFFERED: "1" # 컨테이너 로그 실시간 출력(stdout 버퍼링 끔)
|
|
volumes:
|
|
- ./negodata/backend:/app # 호스트 소스 = 컨테이너 코드. 이게 있어야 수정이 즉시 반영됨
|
|
ports:
|
|
- "9400:9400"
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
restart: unless-stopped
|
|
|
|
# negodata 프론트 (Vite dev 서버).
|
|
negodata-front:
|
|
build: ./negodata/front
|
|
container_name: negodata-front
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./negodata/front:/app
|
|
- /app/node_modules
|
|
restart: unless-stopped
|
|
|
|
# 협상 에이전트 (negosium_db 공유, learning 스키마 사용).
|
|
agent:
|
|
build: ./agent
|
|
container_name: negosium-agent
|
|
environment:
|
|
APP_ENV: local
|
|
DB_HOST: host.docker.internal # 컨테이너→호스트 DB (config.local.toml의 127.0.0.1 override)
|
|
ports:
|
|
- "9500:9500"
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
restart: unless-stopped
|
|
|
|
# negosium 공급사 프론트 (프로덕션 빌드 정적 서빙, :3300). 브라우저가 backend(:9300)를 직접 호출.
|
|
negosium-front:
|
|
build: ./frontend
|
|
container_name: negosium-front
|
|
ports:
|
|
- "3300:3300"
|
|
restart: unless-stopped
|