Skip to content

Commit

Permalink
Adds example of running pa11y-ci in Docker (#137)
Browse files Browse the repository at this point in the history
Co-authored-by: Joey Ciechanowicz <joeyciechanowicz@users.noreply.github.com>
  • Loading branch information
joeyciechanowicz and joeyciechanowicz authored May 19, 2021
1 parent 00ac4f9 commit 6846233
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ CI runs accessibility tests against multiple URLs and reports on any issues. Thi
- [Default configuration](#default-configuration)
- [URL configuration](#url-configuration)
- [Sitemaps](#sitemaps)
- [Docker](#docker)
- [Tutorials and articles](#tutorials-and-articles)
- [Contributing](#contributing)
- [License](#license)
- [Support and Migration](#support-and-migration)
- [Licence](#licence)


## Requirements
Expand Down Expand Up @@ -137,6 +139,38 @@ The above would ensure that you run Pa11y CI against local URLs instead of the l

If there are items in the sitemap that you'd like to exclude from the testing (for example PDFs) you can do so using the `--sitemap-exclude` flag.

### Docker

If you want to run `pa11y-ci` in a Docker container then you can use the [`buildkite/puppeteer`](https://github.com/buildkite/docker-puppeteer) image as this installs Chrome and all the required libs to run headless chrome on Linux.

You will need a `config.json` that sets the `--no-sandbox` Chromium launch arguments:
```json
{
"defaults": {
"chromeLaunchConfig": {
"args": [
"--no-sandbox"
]
}
},
"urls": [
"http://pa11y.org/",
"http://pa11y.org/contributing"
]
}
```

And then a Dockerfile that installs `pa11y-ci` and adds the `config.json`

```Dockerfile
FROM buildkite/puppeteer:v1.15.0

RUN npm install --global --unsafe-perm pa11y-ci
ADD config.json /usr/config.json

ENTRYPOINT ["pa11y-ci", "-c", "/usr/config.json"]
```


## Tutorials and articles

Expand Down

0 comments on commit 6846233

Please sign in to comment.