WIP: Dodaj wsparcie dla Dockera #128

Draft
d33tah wants to merge 46 commits from d33tah/rentgen:develop into develop
Showing only changes of commit 1f47574afe - Show all commits

View File

@ -73,10 +73,48 @@ FROM builder AS runtime
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
firefox-esr \ firefox-esr \
xvfb \ xvfb \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Set display for Xvfb # Set display for Xvfb
ENV DISPLAY=:99 ENV DISPLAY=:99
# Start Xvfb and run extension in Firefox # Create startup script with verbose logging and verification
CMD Xvfb :99 -screen 0 1024x768x24 & npm run ext-test 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"]