-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update dockerfile with pa11y-ci #7
Conversation
also removed some lines that are now included by default in the base alekzonder/puppeteer:1 image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking good. I have a couple minor tweaks I'd like to see taken care of.
&& mkdir -p /home/pptruser/Downloads \ | ||
&& chown -R pptruser:pptruser /home/pptruser \ | ||
&& chown -R pptruser:pptruser /screenshots \ | ||
&& chown -R pptruser:pptruser /usr/local/share/.config/yarn/global/node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By dropping these permissions, can the pptuser still take screenshots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so, but I have not tested the screenshot capability myself. These permissions are now included in the starting dockerfile here: https://hub.docker.com/r/alekzonder/puppeteer/~/dockerfile/
Dockerfile
Outdated
&& chown -R pptruser:pptruser /screenshots \ | ||
&& chown -R pptruser:pptruser /usr/local/share/.config/yarn/global/node_modules | ||
RUN yarn global add pa11y@5 | ||
RUN yarn global add pa11y-ci@2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have one of the following to minimize the number of layers?
RUN yarn global add pa11y@5 pa11y-ci@2
or
RUN yarn global add pa11y@5 && yarn global add pa11y-ci@2
Also, is it the case we need to explicitly add pa11y? We can't invoke it if it's a dependency of pa11y-ci?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed that pa11y needs to be explicitly added. If pa11y-ci gets added globally, that doesn't give access to pa11y globally
Dockerfile
Outdated
|
||
USER pptruser | ||
|
||
ENTRYPOINT ["dumb-init", "--", "pa11y"] | ||
ENTRYPOINT ["dumb-init", "--"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the flexibility here, but if we remove pa11y as part of the entrypoint, the -h flag in command will be an error.
I think we'll need to remove the CMD statement entirely.
This approach leaves us with:
docker run --rm outrigger/pa11y pa11y <url>
or
docker run --rm outrigger/pa11y pa11y-ci
a bit redundant, but we can work with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From sidebar chat, maybe CMD should be "bash -c"?
also removed some lines that are now included by default in the base alekzonder/puppeteer:1 image