forked from icd/rentgen
feat(docker): dodaj weryfikację uruchomienia extensiona
- Skrypt sprawdza czy extension rzeczywiście się zainstalował - Wyświetla czytelny komunikat sukcesu z info o procesach - Capture output web-ext do /tmp/web-ext.log dla weryfikacji - Timeout 30s na instalację extensiona - Pokazuje PID Firefox i Xvfb Weryfikacja pokazuje: ✓ Extension installed: rentgen@internet-czas-dzialac.pl ✓ Firefox ESR running in headless mode ✓ Xvfb running on display :99 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
165df535da
commit
1f47574afe
42
Dockerfile
42
Dockerfile
@ -73,10 +73,48 @@ FROM builder AS runtime
|
||||
RUN apt-get update && apt-get install -y \
|
||||
firefox-esr \
|
||||
xvfb \
|
||||
procps \
|
||||
&& 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
|
||||
# Create startup script with verbose logging and verification
|
||||
RUN echo '#!/bin/bash\n\
|
||||
set -e\n\
|
||||
echo "Starting Xvfb on display :99..."\n\
|
||||
Xvfb :99 -screen 0 1024x768x24 &\n\
|
||||
XVFB_PID=$!\n\
|
||||
sleep 2\n\
|
||||
\n\
|
||||
echo "Xvfb started with PID: $XVFB_PID"\n\
|
||||
echo "Starting web-ext run with verbose logging..."\n\
|
||||
echo "========================================"\n\
|
||||
\n\
|
||||
# Run web-ext with verbose logging and capture output\n\
|
||||
npx web-ext run --verbose 2>&1 | tee /tmp/web-ext.log &\n\
|
||||
WEBEXT_PID=$!\n\
|
||||
\n\
|
||||
# Wait for extension installation confirmation\n\
|
||||
echo "Waiting for extension to install..."\n\
|
||||
for i in {1..30}; do\n\
|
||||
if grep -q "Installed /app as a temporary add-on" /tmp/web-ext.log 2>/dev/null; then\n\
|
||||
echo "========================================"\n\
|
||||
echo "✓ SUCCESS: Extension installed!"\n\
|
||||
echo "✓ Firefox is running in headless mode"\n\
|
||||
echo "✓ Extension: rentgen@internet-czas-dzialac.pl"\n\
|
||||
echo "✓ Process info:"\n\
|
||||
ps aux | grep -E "(firefox|Xvfb)" | grep -v grep | head -3\n\
|
||||
echo "========================================"\n\
|
||||
echo "Extension is ready. Press Ctrl+C to stop."\n\
|
||||
break\n\
|
||||
fi\n\
|
||||
sleep 1\n\
|
||||
done\n\
|
||||
\n\
|
||||
# Keep container running and show logs\n\
|
||||
wait $WEBEXT_PID\n\
|
||||
' > /app/start.sh && chmod +x /app/start.sh
|
||||
|
||||
# Start script
|
||||
CMD ["/app/start.sh"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user