2026-04-06 19:36:13 +02:00
|
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
|
# 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 . .
|
|
|
|
|
|
2026-04-06 19:54:19 +02:00
|
|
|
RUN chmod +x /app/start.sh
|
|
|
|
|
|
2026-04-06 20:09:29 +02:00
|
|
|
# Locate sitespeed.js at build time and write the path to /sitespeed_env.
|
|
|
|
|
# The base image sets sitespeed.io as ENTRYPOINT via a full path, so it is
|
|
|
|
|
# not on $PATH. We find it once here so start.sh can export it at runtime.
|
|
|
|
|
RUN SITESPEED_JS=$(find / -name 'sitespeed.js' -path '*/bin/*' 2>/dev/null | head -1); \
|
|
|
|
|
echo "Build-time sitespeed.js found at: $SITESPEED_JS"; \
|
|
|
|
|
echo "export SITESPEED_BIN=$SITESPEED_JS" > /sitespeed_env
|
|
|
|
|
|
2026-04-06 19:36:13 +02:00
|
|
|
# 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 \
|
|
|
|
|
NODE_ENV=production
|
|
|
|
|
|
2026-04-06 19:50:02 +02:00
|
|
|
EXPOSE 3132
|
2026-04-06 19:36:13 +02:00
|
|
|
|
2026-04-06 19:54:19 +02:00
|
|
|
# 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"]
|