Some checks failed
CD Pipeline / deploy (push) Failing after 5m18s
🔴 Critical - auto_heal_service: 補 import re + sqlalchemy.text + 修正 orchestrator 變數名 + autoheal_playbook→playbooks 表名 + _alert_and_store cooldown 修復 - aider_heal_executor: shell injection 改 shell=False + list 參數 - docker-compose: DISABLE_LOGIN 改 env var + 移除密碼 fallback + POSTGRES_HOST 修正 - app.py: /api/backup /api/run_task 等 6 個管理 API 加 @login_required - config.py + pg_sync + e2e_test: 移除 wooo_pg_2026 hardcoded 密碼 fallback - pg_backup.sh: 移除 TELEGRAM_TOKEN= 中間變數,直接用 $TELEGRAM_BOT_TOKEN - migration 014: trigger_pattern→match_pattern + 補 error_type NOT NULL 欄位 🟡 High - telegram_bot_service: str(e) 改通用訊息 + session try/finally + 移除 pa:/pr: 舊 callback - run_scheduler: ElephantAlpha thread 死亡監控 + 自動重啟 + Telegram 告警 + agent_context 03:30 TTL 定時清理任務 - openclaw_learning_service: build_rag_context 兩路徑加 .limit(200) - hooks: commit-quality + momo-prod-guard 空 catch 改 stderr+exit(1) - scripts/code_review: auto_yes 預設改 false - db_backup_service: PGPASSWORD 透過 env dict 傳遞 📦 Migrations - 013_autoheal: 修正建表順序 playbooks→incidents(外鍵前向引用) - 018_add_missing_indexes: heal_logs/incidents 外鍵索引 + cleanup_expired_agent_context() 🟢 Infrastructure - requirements.txt: 加版本下界 Flask>=2.3 SQLAlchemy>=1.4 等 - cd.yaml: 新增 run_scheduler.py + run_telegram_bot.py 監聽路徑 - .gitignore: insert_playbook_local.py 加入忽略 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
69 lines
1.8 KiB
Docker
69 lines
1.8 KiB
Docker
FROM python:3.11-slim
|
||
|
||
# 設定工作目錄
|
||
WORKDIR /app
|
||
|
||
# 安裝系統依賴 (包含 PostgreSQL 客戶端庫 + Chrome/Selenium 依賴)
|
||
# 注意:Debian Trixie 已移除 libgconf-2-4,改用 libglib2.0-0
|
||
RUN apt-get update && apt-get install -y \
|
||
gcc \
|
||
g++ \
|
||
curl \
|
||
libpq-dev \
|
||
postgresql-client \
|
||
# Chrome/Selenium 依賴
|
||
wget \
|
||
gnupg \
|
||
unzip \
|
||
libnss3 \
|
||
libglib2.0-0 \
|
||
libfontconfig1 \
|
||
libx11-xcb1 \
|
||
libasound2t64 \
|
||
libatk1.0-0 \
|
||
libatk-bridge2.0-0 \
|
||
libcups2 \
|
||
libdrm2 \
|
||
libgbm1 \
|
||
libgtk-3-0 \
|
||
libxcomposite1 \
|
||
libxdamage1 \
|
||
libxrandr2 \
|
||
xdg-utils \
|
||
fonts-liberation \
|
||
libappindicator3-1 || true \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 安裝 Chrome (使用新版 GPG 金鑰管理方式,apt-key 已被移除)
|
||
RUN mkdir -p /etc/apt/keyrings \
|
||
&& wget -q -O /etc/apt/keyrings/google-chrome.asc https://dl.google.com/linux/linux_signing_key.pub \
|
||
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.asc] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
|
||
&& apt-get update \
|
||
&& apt-get install -y google-chrome-stable \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 複製 requirements
|
||
COPY requirements.txt .
|
||
|
||
# 安裝 Python 依賴
|
||
RUN pip install --no-cache-dir -r requirements.txt
|
||
|
||
# 複製應用程式
|
||
COPY . .
|
||
|
||
# 建立必要的目錄
|
||
RUN mkdir -p data logs backups
|
||
|
||
# 確保 components symlink 正確(根目錄頁面需要此路徑)
|
||
RUN rm -rf /app/components && ln -sf /app/web/templates/components /app/components
|
||
|
||
# 設定環境變數
|
||
ENV PYTHONUNBUFFERED=1
|
||
ENV FLASK_APP=app.py
|
||
|
||
# 暴露端口
|
||
EXPOSE 5000
|
||
|
||
# 啟動應用
|
||
CMD ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "app:app"]
|