chore: update Dockerfile in troubleshooting.md (#7015)

Update to fix no package.json failure on some systems
This commit is contained in:
Conrad Magnus Kirschner 2021-09-11 10:44:53 +02:00 committed by GitHub
parent 040a0e561b
commit 0075a714fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,13 +291,16 @@ RUN apt-get update \
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install puppeteer so it's available in the container.
RUN npm i puppeteer \
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 /node_modules \
&& chown -R pptruser:pptruser /package.json \
&& chown -R pptruser:pptruser /package-lock.json
# Run everything after as non-privileged user.
USER pptruser