Skip to content

Commit

Permalink
Set up dev container
Browse files Browse the repository at this point in the history
The idea is with being able to resort to the dev container the
occasional Apple Silicon user will not need to follow the extra steps in
order to be able to run tests with headless Puppeteer/Chrome.
  • Loading branch information
carhartl committed Jun 25, 2023
1 parent e8ee063 commit 5a9abb5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:0-18
RUN apt-get update && apt-get install -y chromium xvfb
USER node
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,13 @@
{
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile"
},
"capAdd": ["SYS_ADMIN"],
"containerEnv": {
"DISPLAY": ":99",
"PUPPETEER_EXECUTABLE_PATH": "/usr/bin/chromium",
"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD": "true"
},
"postStartCommand": "Xvfb :99 -ac -screen 0 1280x720x16 -nolisten tcp -nolisten unix &"
}

0 comments on commit 5a9abb5

Please sign in to comment.