-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dockerfile * launchOptions for browser run in container
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:lts-alpine | ||
|
||
# Installation of packages for purple-hats and chromium | ||
RUN apk add --no-cache g++ make python3 chromium zip bash git | ||
|
||
WORKDIR /app | ||
|
||
# Copy package.json to working directory, perform npm install before copying the remaining files | ||
COPY package*.json ./ | ||
|
||
# Environment variables for node | ||
ENV NODE_ENV=production | ||
|
||
RUN npm ci --omit=dev | ||
|
||
COPY . . | ||
|
||
# Add non-privileged user so we don't need puppeteer --no-sandbox. | ||
RUN addgroup -S purple && adduser -S -G purple purple | ||
RUN chown -R purple:purple ./ | ||
|
||
# Run everything after as non-privileged user. | ||
USER purple | ||
|
||
# Environment variables for chromium | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ | ||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters