FROM node:slim # We don't need the standalone Chromium ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Install Google Chrome Stable and fonts # Note: this installs the necessary libs to make the browser work with Puppeteer. RUN apt-get update && apt-get install gnupg wget -y && \ wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \ sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \ apt-get update && \ apt-get install google-chrome-stable -y --no-install-recommends && \ rm -rf /var/lib/apt/lists/* # Setting up the work directory WORKDIR /scrapper #Copying all the files in our project COPY . . # Installing dependencies RUN npm install # Add user so we don't need --no-sandbox. # same layer as npm install to keep re-chowned files from using up several hundred MBs more space # RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \ # && mkdir -p /home/pptruser/Downloads \ # && chown -R pptruser:pptruser /home/pptruser \ # && chown -R pptruser:pptruser ./node_modules \ # && chown -R pptruser:pptruser ./package.json \ # && chown -R pptruser:pptruser ./package-lock.json # # Run everything after as non-privileged user. # USER pptruser # Starting our application #CMD [ "npm", "run", "debug-cluster" ] CMD [ "npm", "run", "dev" ] # Exposing server port EXPOSE 80