63 lines
1.4 KiB
Docker
63 lines
1.4 KiB
Docker
# GhostQA Base Image
|
|
# Pre-configured headless display with noVNC for AI visual testing
|
|
|
|
FROM python:3.11-slim
|
|
|
|
# Install display and VNC dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
xvfb \
|
|
x11vnc \
|
|
novnc \
|
|
websockify \
|
|
# Qt/GUI dependencies
|
|
libxcb-cursor0 \
|
|
libxcb-icccm4 \
|
|
libxcb-image0 \
|
|
libxcb-keysyms1 \
|
|
libxcb-randr0 \
|
|
libxcb-render-util0 \
|
|
libxcb-shape0 \
|
|
libxcb-xfixes0 \
|
|
libxcb-xinerama0 \
|
|
libxcb-xkb1 \
|
|
libxkbcommon-x11-0 \
|
|
libegl1 \
|
|
libgl1 \
|
|
libfontconfig1 \
|
|
libdbus-1-3 \
|
|
# Utilities
|
|
procps \
|
|
net-tools \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up virtual display
|
|
ENV DISPLAY=:99
|
|
ENV QT_QPA_PLATFORM=xcb
|
|
|
|
# Create startup script
|
|
RUN echo '#!/bin/bash\n\
|
|
set -e\n\
|
|
\n\
|
|
# Start virtual framebuffer\n\
|
|
Xvfb :99 -screen 0 ${SCREEN_WIDTH:-1280}x${SCREEN_HEIGHT:-720}x24 &\n\
|
|
sleep 1\n\
|
|
\n\
|
|
# Start VNC server\n\
|
|
x11vnc -display :99 -forever -shared -rfbport 5900 -nopw &\n\
|
|
sleep 1\n\
|
|
\n\
|
|
# Start noVNC (web-based VNC client)\n\
|
|
websockify --web=/usr/share/novnc/ ${NOVNC_PORT:-6080} localhost:5900 &\n\
|
|
\n\
|
|
echo "GhostQA display ready on port ${NOVNC_PORT:-6080}"\n\
|
|
echo "Connect via browser: http://localhost:${NOVNC_PORT:-6080}/vnc.html"\n\
|
|
\n\
|
|
# Run the target application\n\
|
|
exec "$@"\n\
|
|
' > /usr/local/bin/ghostqa-start && chmod +x /usr/local/bin/ghostqa-start
|
|
|
|
EXPOSE 6080
|
|
|
|
ENTRYPOINT ["/usr/local/bin/ghostqa-start"]
|
|
CMD ["bash"]
|