# prod(운영 서버, Docker) 설정 — 복사해서 사용: cp config.prod.toml.example config.prod.toml # 실제 config.prod.toml 은 시크릿 포함이라 커밋하지 않는다(.gitignore: *.toml). # # 실행: ./lps/run_docker.sh 에서 prod 선택(권장) — guard 키 미설정 경고 + API 포트 127.0.0.1 바인드까지 처리 # (수동: APP_ENV=prod LPS_API_BIND=127.0.0.1 docker compose up -d lps-api lps-worker) # prod 필수 체크: ① api_keys 채움 ② negodata 쪽 lps_api_key 에 같은 키 ③ 알림 webhook 권장 # compose 가 이 파일을 컨테이너에 마운트하고 APP_ENV 로 선택한다. 이미지에는 시크릿이 없다 — # 마운트를 잊으면 기동 시 FileNotFoundError 로 즉시 실패(조용한 오동작 없음). # local 과의 차이만 주석으로 표시 — 나머지 의미는 config.local.toml.example 참고. [WebServerConfig] server_name = "LpsServer" port = 9600 process_count = 1 # API 병목은 드묾(단일로 ~1,100 RPS 실측). 부하 대비 시에만 코어 수만큼 is_ssl = false is_test = false cors_origins = [] api_keys = [""] # prod 필수 — 비우면 개방 모드(위험). 복수 등록=무중단 교체 [LogConfig] print_console = true log_level = "info" # prod 는 debug 금지(로그량·민감정보) [MainDBConfig] db_type = "postgresql" name = "lps_db" write_host = "host.docker.internal" # 컨테이너 → 호스트 DB (전용 DB 서버면 그 호스트로) write_port = 5432 write_id = "" write_pw = "" read_host = "host.docker.internal" read_port = 5432 read_id = "" read_pw = "" show_log = false pool_size = 10 max_overflow = 20 connection_budget = 40 # 전용 PG(max_connections≈100)면 90 근처로 상향. 관리형 DB 면 sslmode 도 확인 sslmode = "" [WorkerConfig] concurrency = 1 fallbacks = [] profile_dir = "/profiles" # compose 의 영속 볼륨(lps-profiles) — 재시작에도 cf_clearance 유지 job_deadline_sec = 300 shutdown_grace_sec = 60 chrome_channel = "chrome" chrome_executable = "/usr/bin/chromium" # 컨테이너는 시스템 chromium + Xvfb(headful) heartbeat_file = "/tmp/lps_worker_heartbeat" [AlertConfig] webhook = "" # prod 는 채우기를 권장 — 없으면 임계 알림이 로그로만 남는다(docs/operations.md) cooldown_min = 30 dead_1h = 20 blocks_1h = 80 queue_lag_sec = 300 pool_pct = 90 source_fail_30m = 5 deadline_1h = 5 cost_1h_usd = 1.0 ports_low_pct = 30 block_sessions_6h = 1 [NaverConfig] [[NaverConfig.keys]] id = "" secret = "" [OpenAIConfig] api_key = "" # 비면 AI 판정 OFF model = "gpt-4o-mini" [DecodoConfig] host = "" # 4종(호스트·계정·포트범위) 비면 프록시 미사용(직접 연결) username = "" password = "" port_start = 0 port_end = 0 session_minutes = 10 cost_per_gb = 0.0 ip_request_budget = 3 port_cooldown_sec = 0