Files
tubestation/testing/web-platform/tests/docs/Dockerfile
Raphael Kubo da Costa 5540dcaa29 Bug 1847046 [wpt PR 41320] - docs Dockerfile: Use python:3.11 base image, a=testonly
Automatic update from web-platform-tests
docs Dockerfile: Use python:3.11 base image

Instead of using a somewhat old Ubuntu release as base and installing its
somewhat old Python package, use a base image that already has Python at the
same version we also use for the GitHub workflow that generates
documentation.

"python:3.11" is equivalent to the latest 3.11 release installed on Debian
bookworm (aka stable at the moment of writing).

I have tested this locally and the documentation generated locally finally
looked similar to the published version -- there seemed to be some issue
with Ubuntu 20.04's Python 3.8 and docutils and/or Sphinx that added an
extra ":" after e.g. "Arguments" in the documentation.

--

wpt-commits: 89b0e123c1d078944ee38a6e79382dbfc1accfea
wpt-pr: 41320
2023-09-28 14:57:37 +00:00

24 lines
661 B
Docker

FROM python:3.11
# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get -qqy update \
&& apt-get -qqy install git npm
WORKDIR /app/
COPY package.json requirements.txt ./
RUN npm install .
ENV PATH=/app/node_modules/.bin:$PATH
# Use venv to create a virtual environment with the docs dependencies installed,
# setting the environment variables needed for this to always be active. The
# `./wpt build-docs` then uses this venv with --skip-venv-setup.
ENV VIRTUAL_ENV=/app/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH=$VIRTUAL_ENV/bin:$PATH
RUN pip install -r requirements.txt