[fix] lps: 워커 이미지 chromium→google-chrome-stable 교체 (쿠팡 Akamai 지문 차단 회피)

This commit is contained in:
Mina Choi 2026-07-24 17:12:20 +09:00
parent b539e073cb
commit f9d37e08f4
2 changed files with 12 additions and 7 deletions

View File

@ -4,13 +4,18 @@
#
# 빌드/실행:
# docker compose build lps-worker && docker compose up -d lps-worker
# 스텔스 참고: 로컬 Mac 은 실제 Chrome(channel=chrome), 컨테이너는 시스템 chromium(executable_path).
# 프로덕션에서 stealth 가 부족하면 amd64 이미지에 google-chrome-stable 설치 후 LPS_CHROME_CHANNEL=chrome 로 전환.
# 스텔스 참고: 로컬 Mac 은 실제 Chrome(channel=chrome), 컨테이너도 실제 google-chrome-stable(executable_path).
# 오픈소스 chromium 은 Akamai(쿠팡)가 지문으로 차단(실측: errors.edgesuite.net, IP 첫 요청부터) → 실제 Chrome 필수.
FROM python:3.14-slim
# chromium(런타임 의존성 apt 가 자동 해결) + Xvfb + 한글 폰트
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium xvfb xauth fonts-nanum ca-certificates \
# 실제 Chrome(구글 apt 저장소, amd64 전용) + Xvfb + 한글 폰트
RUN apt-get update && apt-get install -y --no-install-recommends wget gnupg \
&& wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
| gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y --no-install-recommends \
google-chrome-stable xvfb xauth fonts-nanum ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
@ -25,7 +30,7 @@ RUN cp config/config.local.toml.example config/config.local.toml
ENV APP_ENV=local \
PYTHONUNBUFFERED=1 \
LPS_CHROME_EXECUTABLE=/usr/bin/chromium \
LPS_CHROME_EXECUTABLE=/opt/google/chrome/chrome \
DISPLAY=:99 \
LPS_HEARTBEAT_FILE=/tmp/lps_worker_heartbeat

View File

@ -53,7 +53,7 @@ profile_dir = ".profiles" # Chrome 프로필 베이스. 영속 경로면
job_deadline_sec = 300 # 잡 1건 처리 상한(크롤 행 방어). 0=무제한(테스트용)
shutdown_grace_sec = 60 # graceful 종료 유예 — docker stop_grace_period 를 이보다 길게
chrome_channel = "chrome" # 로컬: 실제 Chrome
chrome_executable = "" # 컨테이너: "/usr/bin/chromium" (설정 시 channel 무시)
chrome_executable = "" # 컨테이너: "/opt/google/chrome/chrome" (설정 시 channel 무시)
heartbeat_file = "/tmp/lps_worker_heartbeat" # Docker HEALTHCHECK 가 신선도 확인
# 임계 알림 (AlertManager — 룰 의미는 docs/operations.md 표)