1
0
forked from icd/rentgen

feat(docker): dodaj runtime stage z web-ext run

- Dodano nowy stage 'runtime' w Dockerfile
- Instalacja Firefox ESR i Xvfb dla headless execution
- Automatyczne uruchomienie web-ext run z Xvfb
- Dodano usługę rentgen_run w compose.yml
- Zaktualizowana dokumentacja z przykładami użycia

Możliwe użycie:
- docker build --target runtime -t rentgen-run .
- docker run --rm -it rentgen-run
- docker compose up rentgen_run

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jacek Wielemborek 2025-10-25 17:40:45 +02:00
parent d7dc55e94e
commit a06bb028a7
2 changed files with 33 additions and 0 deletions

View File

@ -14,6 +14,14 @@
# Run commands in the container: # Run commands in the container:
# docker run --rm rentgen npm run build:chrome # docker run --rm rentgen npm run build:chrome
# docker run --rm rentgen npm run typecheck # docker run --rm rentgen npm run typecheck
#
# Run extension in Firefox (headless):
# docker build --target runtime -t rentgen-run .
# docker run --rm -it rentgen-run
#
# Using docker-compose:
# docker-compose up rentgen_check # Build only
# docker-compose up rentgen_run # Run in Firefox
# Build stage # Build stage
FROM node:lts AS builder FROM node:lts AS builder
@ -57,3 +65,18 @@ FROM builder
# Default command shows the built artifact # Default command shows the built artifact
CMD ["ls", "-lh", "/app/web-ext-artifacts/"] 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
RUN apt-get update && apt-get install -y \
firefox-esr \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# Set display for Xvfb
ENV DISPLAY=:99
# Start Xvfb and run extension in Firefox
CMD Xvfb :99 -screen 0 1024x768x24 & npm run ext-test

10
compose.yml Normal file
View File

@ -0,0 +1,10 @@
services:
rentgen_check:
build: .
rentgen_run:
build:
context: .
target: runtime
stdin_open: true
tty: true