feat: update Dockerfile and documentation for platform-specific dependency generation

This commit is contained in:
2025-11-04 22:31:27 +01:00
parent 56b8b832db
commit 3116312cbc
4 changed files with 27 additions and 4 deletions

View File

@@ -3,6 +3,8 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Let Docker generate platform-specific lockfile
package-lock.json
# Build outputs
dist/

6
.gitignore vendored
View File

@@ -15,4 +15,8 @@ accounts.main.jsonc
.DS_Store
.playwright-chromium-installed
*.log
.update-backup/
.update-backup/
# Exclude package-lock.json from repo for cross-platform compatibility
# Each platform (Windows/Linux/Raspberry Pi/Docker) generates its own
package-lock.json

View File

@@ -8,10 +8,12 @@ WORKDIR /usr/src/microsoft-rewards-script
ENV PLAYWRIGHT_BROWSERS_PATH=0
# Copy package files
COPY package.json package-lock.json tsconfig.json ./
COPY package.json tsconfig.json ./
# Install all dependencies required to build the script
RUN npm ci --ignore-scripts
# Generate fresh lockfile for target platform architecture
# This ensures native dependencies are resolved correctly
RUN npm install --ignore-scripts --package-lock-only \
&& npm ci --ignore-scripts
# Copy source and build
COPY . .

View File

@@ -186,6 +186,21 @@ docker inspect --format='{{.State.Health.Status}}' microsoft-rewards-script
## ⚠️ Important Notes
### Platform Compatibility
The Docker build **automatically generates platform-specific dependencies** for the target architecture:
- ✅ **Windows (x86_64)** — Fully supported
- ✅ **Linux (x86_64)** — Fully supported
- ✅ **Raspberry Pi (ARM64)** — Fully supported
- ✅ **macOS (ARM64/Apple Silicon)** — Fully supported
The build process regenerates `package-lock.json` inside the container to ensure native dependencies (Playwright, etc.) match the target platform. This means:
- **No cross-platform compatibility issues**
- **Native performance on all architectures**
- **Raspberry Pi users won't encounter binary mismatch errors**
### Buy Mode Not Supported
**Buy Mode cannot be used in Docker** because it requires interactive terminal input. Use Buy Mode only in local installations: