Giter VIP home page Giter VIP logo

docker-pa11y's Introduction

Outrigger pa11y

Docker image for pa11y, the CLI-based accessibility testing tool.

GitHub tag Docker Stars Docker Pulls

This Docker image provides the use of pa11y v5. (Note that the v5 version of that project is currently not in the master branch.)

Usage Examples

Docker Run

This is a quick demonstration of how you can use pa11y to run checks against a given URL.

docker run -i --rm --cap-add=SYS_ADMIN \
  --name pa11y outrigger/pa11y:1 http://outrigger.sh

Docker-Compose - Simple

This is the docker-compose style to execute the same docker run command as above.

version: '3.3'
services:
  pa11y:
    image: outrigger/pa11y:1
    container_name: projectname_${DOCKER_ENV:-local}_pa11y
    command: http://outrigger.sh
    network_mode: bridge
    cap_add:
      - SYS_ADMIN

Docker-Compose - Project

This is an example service definition to run pa11y as part of your project.

Since you would not run this operationally alongside your webserver, this should not be added to your main docker-compose.yml. Instead, it might go in a build.yml or wherever you are defining CLI or testing tools.

# docker-compose -f build.yml run --rm pa11y
version: '3.3'
services:
  pa11y:
    image: outrigger/pa11y:1
    container_name: projectname_${DOCKER_ENV:-local}_pa11y
    command: ["--config", "/code/pa11y/config.js"]
    network_mode: bridge
    volumes:
      # Inject your pa11y configuration. We assume you have a config.js script.
      - ./tests/pa11y/:/code/pa11y/
    cap_add:
      - SYS_ADMIN

pa11y Configuration File

This is a start for your configuration file.

The default customizations to chrome ensures HTTPS errors are ignored and that Chrome has enough memory.

const browser = await puppeteer.launch({
    ignoreHTTPSErrors: true,
    args: [
      '--disable-dev-shm-usage'
    ],
});

pa11y('http://outrigger.sh', {
    browser: browser
});

browser.close();

Screenshot Example

This is an example of reaching around pa11y to the underlying screenshot tools built into the base puppeteer image we are using, alekzonder/puppeteer

docker run -it --rm \
  --shm-size 1G \
  -v $PWD:/screenshots \
  --entrypoint ""
  outrigger/pa11y:1 \
  screenshot_series 'http://outrigger.sh' 1366x768

Resources

Security Reports

Please email [email protected] with security concerns.

Maintainers

Phase2 Logo

docker-pa11y's People

Contributors

grayside avatar jhedstrom avatar tjheffner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.