# Offscreen render harness for tools/capture.sh: a private X server (Xvfb) and Mesa's
# software rasterizers, so Godot can render the real client without any host display,
# GPU or audio device. Built as image tidewall-capture.
FROM debian:13

RUN apt-get update \
	&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
		xvfb xauth \
		libgl1 libgl1-mesa-dri libglx-mesa0 libegl1 libgles2 \
		mesa-vulkan-drivers libvulkan1 \
		libx11-6 libxcursor1 libxinerama1 libxrandr2 libxi6 libxext6 libxrender1 \
		libxkbcommon0 libxkbcommon-x11-0 \
		libfontconfig1 libdbus-1-3 libasound2t64 libpulse0 libudev1 \
	&& rm -rf /var/lib/apt/lists/*

# Never touch a real GPU, even if a device were passed in by mistake.
ENV LIBGL_ALWAYS_SOFTWARE=1 \
	GALLIUM_DRIVER=llvmpipe \
	VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json \
	HOME=/tmp/home

COPY entrypoint.sh /usr/local/bin/tidewall-capture
ENTRYPOINT ["/usr/local/bin/tidewall-capture"]
