Docker puppeteer work around (revert this later)

- Tracked at https://github.com/dawnlabs/carbon/issues/451
main
Mike Fix 6 years ago
parent cc2cafaca5
commit 02d2a9592f

@ -1,18 +1,23 @@
FROM node:9-alpine FROM node:9-alpine
# Installs latest Chromium (63) package. # Source https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
# Installs latest Chromium (68) package.
ENV CHROME_BIN=/usr/bin/chromium-browser
RUN apk update && apk upgrade && \ RUN apk update && apk upgrade && \
echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \ echo @v3.8 http://nl.alpinelinux.org/alpine/v3.8/community >> /etc/apk/repositories && \
echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \ echo @v3.8 http://nl.alpinelinux.org/alpine/v3.8/main >> /etc/apk/repositories && \
apk add --no-cache \ apk add --no-cache \
chromium@edge \ chromium@v3.8 \
nss@edge nss@v3.8
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
COPY yarn.lock ./ COPY yarn.lock ./
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
RUN yarn RUN yarn
COPY . . COPY . .
@ -30,4 +35,4 @@ USER pptruser
ENV NODE_ENV production ENV NODE_ENV production
EXPOSE 3000 EXPOSE 3000
CMD [ "yarn", "start" ] CMD [ "yarn", "start" ]

@ -17,7 +17,7 @@ module.exports = browser => async (req, res) => {
const targetElement = await page.$('#export-container') const targetElement = await page.$('#export-container')
const dataUrl = await page.evaluate(target => { const dataUrl = await page.evaluate((target = document) => {
const config = { const config = {
style: { style: {
transform: 'scale(2)', transform: 'scale(2)',

@ -38,7 +38,7 @@
"ms": "^2.0.0", "ms": "^2.0.0",
"next": "^6.0.3", "next": "^6.0.3",
"now-logs": "^0.0.7", "now-logs": "^0.0.7",
"puppeteer": "^1.0.0", "puppeteer": "0.13.x",
"react": "16.3.*", "react": "16.3.*",
"react-click-outside": "^3.0.0", "react-click-outside": "^3.0.0",
"react-codemirror2": "^5.0.0", "react-codemirror2": "^5.0.0",

@ -29,7 +29,8 @@ const puppeteerParams = dev
? {} ? {}
: { : {
executablePath: '/usr/bin/chromium-browser', executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox'] // TODO args: ['--no-sandbox', '--disable-setuid-sandbox']
args: ['--no-sandbox', '--headless', '--disable-gpu']
} }
app app

@ -4514,10 +4514,6 @@ mime@^1.3.4:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
mime@^2.0.3:
version "2.3.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369"
mimic-fn@^1.0.0: mimic-fn@^1.0.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
@ -5683,14 +5679,14 @@ punycode@^2.1.0:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
puppeteer@^1.0.0: puppeteer@0.13.x:
version "1.4.0" version "0.13.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.4.0.tgz#437f0f3450d76e437185c0bf06f446e80f184692" resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-0.13.0.tgz#2e6956205f2c640964c2107f620ae1eef8bde8fd"
dependencies: dependencies:
debug "^3.1.0" debug "^2.6.8"
extract-zip "^1.6.5" extract-zip "^1.6.5"
https-proxy-agent "^2.1.0" https-proxy-agent "^2.1.0"
mime "^2.0.3" mime "^1.3.4"
progress "^2.0.0" progress "^2.0.0"
proxy-from-env "^1.0.0" proxy-from-env "^1.0.0"
rimraf "^2.6.1" rimraf "^2.6.1"

Loading…
Cancel
Save