diff --git a/Dockerfile b/Dockerfile index 82c960073..4dc87507a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN apt-get update -qq && \ libjemalloc2 \ libssl-dev \ nodejs \ - npm \ postgresql-client \ default-jre-headless \ poppler-utils \ @@ -21,12 +20,15 @@ RUN apt-get update -qq && \ fonts-wqy-microhei \ fonts-wqy-zenhei \ libfile-mimeinfo-perl \ - chromium-driver && \ - npm install -g yarn && \ - yarn add puppeteer@npm:puppeteer-core && \ + chromium-driver \ + yarnpkg && \ ln -s /usr/lib/x86_64-linux-gnu/libvips.so.42 /usr/lib/x86_64-linux-gnu/libvips.so && \ rm -rf /var/lib/apt/lists/* +ENV PATH=/usr/share/nodejs/yarn/bin:$PATH + +RUN yarn add puppeteer@npm:puppeteer-core + ENV BUNDLE_PATH /usr/local/bundle/ # create app directory diff --git a/Dockerfile.production b/Dockerfile.production index 8384a8c79..b5a7a99fb 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -9,14 +9,13 @@ RUN \ apt-get install -y --no-install-recommends \ libssl-dev \ nodejs \ - npm \ - postgresql-client && \ - npm install -g yarn + yarnpkg \ + postgresql-client ENV APP_HOME /usr/src/app ENV RAILS_ENV=production ENV GEM_HOME=$APP_HOME/vendor/bundle/ruby/3.2.0 -ENV PATH=$GEM_HOME/bin:$PATH +ENV PATH=$GEM_HOME/bin:/usr/share/nodejs/yarn/bin:$PATH ENV BUNDLE_APP_CONFIG=.bundle ENV BUNDLE_BUILD__SASSC=--disable-march-tune-native @@ -69,7 +68,7 @@ RUN \ libjemalloc2 \ groff-base \ postgresql-client \ - npm \ + nodejs \ awscli \ netcat-openbsd \ poppler-utils \ @@ -77,9 +76,9 @@ RUN \ libvips42 \ graphviz \ chromium \ - libfile-mimeinfo-perl && \ - npm install -g yarn && \ - yarn add puppeteer@npm:puppeteer-core && \ + libfile-mimeinfo-perl \ + yarnpkg && \ + /usr/share/nodejs/yarn/bin/yarn add puppeteer@npm:puppeteer-core && \ apt-get install -y libreoffice && \ ln -s /usr/lib/x86_64-linux-gnu/libvips.so.42 /usr/lib/x86_64-linux-gnu/libvips.so