-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
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,41 @@ | ||
FROM alpine:edge | ||
|
||
RUN apk update | ||
# Installs latest Chromium (89) package. | ||
RUN apk add --no-cache \ | ||
chromium \ | ||
nss \ | ||
freetype \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont \ | ||
nodejs \ | ||
npm \ | ||
yarn | ||
|
||
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package. | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ | ||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | ||
|
||
# Puppeteer v6.0.0 works with Chromium 89. | ||
RUN yarn add [email protected] | ||
|
||
# Add user so we don't need --no-sandbox. | ||
RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \ | ||
&& mkdir -p /home/pptruser/Downloads /app \ | ||
&& chown -R pptruser:pptruser /home/pptruser \ | ||
&& chown -R pptruser:pptruser /app | ||
|
||
|
||
WORKDIR /usr/src/ | ||
COPY package*.json ./ | ||
ADD app ./app | ||
ADD config ./config | ||
RUN npm install | ||
RUN chown -R pptruser:pptruser /usr/src/ | ||
|
||
EXPOSE 8080 | ||
|
||
# Run everything after as non-privileged user. | ||
USER pptruser | ||
CMD [ "npm", "start" ] |
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