Files
speedboard/Dockerfile
Malin 86a44e68bb fix: start Xvfb before Node so Chrome has a display
Without Xvfb running, Chrome exits immediately with code 1.
The base sitespeedio image normally handles this via its own
entrypoint script; we now replicate that with start.sh.
Also drop --headless (breaks visual metrics) and add --disable-gpu
for stable Chrome rendering inside Docker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 19:54:19 +02:00

41 lines
1.4 KiB
Docker

# ─────────────────────────────────────────────────────────────────────────────
# Speedboard Docker image
#
# Based on the official sitespeed.io image which already includes:
# - Node.js 20
# - Chrome & Firefox (headless)
# - Xvfb
# - sitespeed.io CLI
# ─────────────────────────────────────────────────────────────────────────────
FROM sitespeedio/sitespeed.io:latest
WORKDIR /app
# Copy speedboard app files
COPY package.json ./
RUN npm install --omit=dev
COPY . .
RUN chmod +x /app/start.sh
# Create persistent directories
RUN mkdir -p /data/reports
# Symlink reports dir into app folder
RUN ln -sf /data/reports /app/reports
# Runtime env
ENV PORT=3132 \
IN_DOCKER=1 \
# sitespeed.io is already installed at /usr/local/lib/node_modules/sitespeed.io/bin/sitespeed.js
# but we ship our own copy — point to the bundled one inside image
SITESPEED_BIN=/usr/local/lib/node_modules/sitespeed.io/bin/sitespeed.js \
NODE_ENV=production
EXPOSE 3132
# start.sh boots Xvfb (virtual display for Chrome/Firefox) then runs the app.
# This mirrors what the base image's own entrypoint does.
ENTRYPOINT ["/app/start.sh"]