fix: Update Docker configuration to improve volume mounts and remove unnecessary Playwright browser copy

This commit is contained in:
2025-11-14 07:35:02 +01:00
parent 7fbecc7dcc
commit 661f3f0ab0
3 changed files with 4 additions and 9 deletions

View File

@@ -41,9 +41,8 @@ docs/
.gitlab-ci.yml
# Session and runtime data (mounted as volumes)
sessions/
# Note: sessions/ NOT excluded - needed for volume mount in Docker
reports/
browser/
# Development files
*.log

View File

@@ -79,10 +79,6 @@ 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

View File

@@ -8,9 +8,9 @@ services:
# Volume mounts: Specify a location where you want to save the files on your local machine.
volumes:
- ./src/accounts.jsonc:/usr/src/microsoft-rewards-bot/dist/accounts.jsonc:ro
- ./src/config.jsonc:/usr/src/microsoft-rewards-bot/dist/config.jsonc:ro
- ./sessions:/usr/src/microsoft-rewards-bot/dist/browser/sessions # Optional, saves your login session
- ../src/accounts.jsonc:/usr/src/microsoft-rewards-bot/dist/accounts.jsonc:ro
- ../src/config.jsonc:/usr/src/microsoft-rewards-bot/dist/config.jsonc:ro
- ../sessions:/usr/src/microsoft-rewards-bot/sessions # Optional, saves your login session
environment:
TZ: "America/Toronto" # Set your timezone for proper scheduling