code/src to the docker container's /usr/src/app. Updated docker volume maps the entire contents of the local. The line that should launch puppeteer const browser = await puppeteer.launch(/code to the docker container's /usr/src/app directory. ![]() # Run everything after as non-privileged user.I'm trying to launch puppeteer in an express app that's run in a docker container, using docker-compose. & chown -R pptruser:pptruser /node_modules npm info lifecycle puppeteer0.10.2install. & chown -R pptruser:pptruser /home/pptruser \ ERROR: Failed to download Chromium r497674 Set PUPPETEERSKIPCHROMIUMDOWNLOAD env variable to skip download. & groupadd -r pptruser & useradd -r -g pptruser -G audio,video pptruser \ disable-gpu Temporarily needed if running on Windows. If youve got Chrome 59+ installed, start Chrome with the -headless flag: chrome. # same layer as npm install to keep re-chowned files from using up several hundred MBs more space The easiest way to get started with headless mode is to open the Chrome binary from the command line. If you do, # you'll need to launch puppeteer with: # browser.launch() # ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Install puppeteer so it's available in the container. & rm -rf /var/lib/apt/lists/ * # If running Docker >= 1.13.0 use docker run's -init arg to reap zombie processes, otherwise # uncomment the following lines to have `dumb-init` as PID 1 # ADD /usr/local/bin/dumb-init # RUN chmod +x /usr/local/bin/dumb-init # ENTRYPOINT # Uncomment to skip the chromium download when installing puppeteer. & apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \ ![]() & sh -c 'echo "deb stable main" > /etc/apt//google.list' \ # FROM node:10-slim # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) # Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer # installs, work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |