diff --git a/Dockerfile b/Dockerfile index cdc7da19..e304c392 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,31 +25,17 @@ RUN pnpm install RUN pnpm build FROM node:18-slim + WORKDIR /app -RUN apt-get update \ - && apt-get install -y wget gnupg \ - && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && 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 -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* - -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true - -RUN npm init -y && \ - npm i puppeteer \ - # 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 - && 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 - -USER pptruser +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true + +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/* RUN yarn config set registry https://registry.npmjs.org/ RUN yarn config set network-timeout 1200000