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>
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -17,6 +17,8 @@ RUN npm install --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN chmod +x /app/start.sh
|
||||
|
||||
# Create persistent directories
|
||||
RUN mkdir -p /data/reports
|
||||
|
||||
@@ -33,8 +35,6 @@ ENV PORT=3132 \
|
||||
|
||||
EXPOSE 3132
|
||||
|
||||
# Override the base image's ENTRYPOINT (which is "sitespeed.io") so that
|
||||
# Docker doesn't prepend it to our CMD, causing sitespeed.io to treat
|
||||
# "node" as a URL to test.
|
||||
ENTRYPOINT ["node"]
|
||||
CMD ["app.js"]
|
||||
# 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"]
|
||||
|
||||
Reference in New Issue
Block a user