1
0
forked from icd/rentgen
rentgen/Dockerfile
Jacek Wielemborek 34cec21992 feat(verify): enhanced Marionette verification with bidirectional communication
Implemented undeniable proof that extension is actively executing:
- Added content script that communicates with background script
- Background script performs verifiable computation (value*2)+3
- Marionette test dispatches event, verifies round-trip communication
- Results stored in DOM attributes (no console.log dependency)
- Mathematical proof ensures extension code is actually running

Test verifies:
1. Content script injection and event listening
2. Message passing from content to background script
3. Background script computation and response
4. Full bidirectional communication chain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 09:21:18 +01:00

85 lines
2.3 KiB
Docker

# Rentgen Browser Extension - Docker Build
# See README.md for detailed usage instructions
# Build stage
FROM node:lts AS builder
WORKDIR /app
# Copy package files for dependency installation (better layer caching)
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy source code (respecting .dockerignore)
COPY . .
# Build the extension for Firefox (default)
RUN npm run build
# Create the package
RUN npm run create-package
# Test stage - for running quality checks
FROM builder AS test
RUN npm run typecheck && npm run lint
# Artifacts stage - only contains the built artifacts (for --output)
FROM scratch AS artifacts
# Copy only the built extension zip file to root
COPY --from=builder /app/web-ext-artifacts/*.zip /
# Default stage - full development environment
FROM builder
# Default command shows the built artifact
CMD ["ls", "-lh", "/app/web-ext-artifacts/"]
# Runtime stage - for running extension in Firefox
FROM builder AS runtime
# Install Firefox and Xvfb for headless execution (cached layer)
RUN apt-get update && apt-get install -y \
firefox-esr \
xvfb \
procps \
&& rm -rf /var/lib/apt/lists/*
# Install Python and pip in a separate layer for better caching
RUN apt-get update && apt-get install -y \
python3-pip \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install geckodriver for WebDriver protocol
RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz \
&& tar -xzf geckodriver-v0.34.0-linux64.tar.gz \
&& mv geckodriver /usr/local/bin/ \
&& rm geckodriver-v0.34.0-linux64.tar.gz \
&& chmod +x /usr/local/bin/geckodriver
# Install Python dependencies for testing
RUN pip3 install --break-system-packages marionette_driver
# Set display for Xvfb
ENV DISPLAY=:99
# Copy startup script for extension testing
COPY scripts/test_start_extension.sh /app/test_start_extension.sh
RUN chmod +x /app/test_start_extension.sh
# Start script
CMD ["/app/test_start_extension.sh"]
# Verify stage - automated testing with exit code
FROM runtime AS verify
# Copy verification script
COPY scripts/test_verify.py /app/test_verify.py
RUN chmod +x /app/test_verify.py
# Run verification and exit with proper exit code
CMD ["python3", "/app/test_verify.py"]