fix: Clean up build system and resolve Docker Chromium persistence issue

- Remove redundant prestart hook (no more "Build not found" message)
- Add prebuild hook for automatic Chromium installation
- Fix Docker Chromium persistence (copy @playwright from builder)
- Simplify npm scripts (11 → 9 commands, better naming)
- Add comprehensive build system documentation
- Add Docker deployment guide with troubleshooting

Fixes: Docker "Chromium not installed" error on subsequent runs
Closes: #[issue-number]
This commit is contained in:
2025-11-13 15:34:02 +01:00
parent 3b06b4ae83
commit 8e2e7fae84
4 changed files with 635 additions and 8 deletions

View File

@@ -79,6 +79,10 @@ COPY --from=builder /usr/src/microsoft-rewards-bot/dist ./dist
COPY --from=builder /usr/src/microsoft-rewards-bot/package*.json ./
COPY --from=builder /usr/src/microsoft-rewards-bot/node_modules ./node_modules
# FIXED: Copy Playwright browsers from builder (they're in node_modules with PLAYWRIGHT_BROWSERS_PATH=0)
# This prevents "Chromium not installed" errors on subsequent runs
COPY --from=builder /usr/src/microsoft-rewards-bot/node_modules/@playwright ./node_modules/@playwright
# Copy runtime scripts with proper permissions and normalize line endings for non-Unix users
# IMPROVED: Scripts now organized in docker/ folder
COPY --chmod=755 docker/run_daily.sh ./docker/run_daily.sh