Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
baschny committed Apr 16, 2020
0 parents commit fd15b96
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
*~
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:12

# Install requirements for chromium in the node:10 distribution (Debian 9 Stretch)
RUN set -ex \
&& apt-get update \
&& apt-get -q install -y -V \
libx11-xcb1 libxtst6 libnss3 libxss1 libasound2 libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*

# Expose necessary ports:
# dashboard:
EXPOSE 4000
# webservice:
EXPOSE 3000

# Run as "node" to avoid security complaints from node and co
USER node
WORKDIR /home/node

# Clone current pa11y-dashboard and install all depenencies (which include pa11y itself and pa11y-webservice)
RUN git clone https://github.com/pa11y/pa11y-dashboard.git pa11y-dashboard \
&& cd pa11y-dashboard \
&& npm install

# Configure for our docker environment with "production" settings
ADD patty-dashboard.production.json pa11y-dashboard/config/production.json
ENV NODE_ENV production

#COPY docker-entrypoint.sh entrypoint.sh

WORKDIR pa11y-dashboard
CMD ["start"]
ENTRYPOINT ["npm"]
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2020 Ernesto Baschny

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build:
docker-compose build

run:
docker-compose up -d

logs:
docker-compose logs -f dashboard
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
docker-pa11y Dashboard in Docker
================================

Test the docker pa11y dashboard and webservice in a docker environment.

Requirements
------------
- Docker and the `docker-compose` tool
- Browser

How to use
----------
Simply start the containers (dashboard and mongo):

If you have `make` installed:
```
make run
```
else:
```
docker-compose up -d
```

Check the logs:
```
make logs
```
or:
```
docker-compose logs -f dashboard
```

Go to the browser:

http://localhost:4000/

See also
--------
- https://pa11y.org/
- https://github.com/pa11y/pa11y-dashboard
- https://github.com/pa11y/pa11y-webservice
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.7"

services:
dashboard:
build: .
ports:
- "4000:4000"
- "3000:3000"
networks:
- intern
mongodb:
image: mongo:3.6
ports:
- "27017"
networks:
- intern
volumes:
- data:/data

volumes:
data:

networks:
intern:
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# Start up the dashboard.
cd /home/node/pa11y-dashboard && npm start
15 changes: 15 additions & 0 deletions patty-dashboard.production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"port": 4000,
"noindex": true,
"readonly": false,
"sitemessage": "Test Dashboard in Docker",
"webservice": {
"database": "mongodb://mongodb/pa11y-webservice",
"host": "127.0.0.1",
"port": 3000,
"cron": "0 30 0 * * *",
"chromeLaunchConfig": {
"args": ["--no-sandbox"]
}
}
}

0 comments on commit fd15b96

Please sign in to comment.