diff --git a/apps/meteor/.docker/Dockerfile.debian b/apps/meteor/.docker/Dockerfile.debian index c8ede9db3cae..7bbca15a9142 100644 --- a/apps/meteor/.docker/Dockerfile.debian +++ b/apps/meteor/.docker/Dockerfile.debian @@ -30,21 +30,27 @@ ENV DEPLOY_METHOD=docker \ RUN aptMark="$(apt-mark showmanual)" \ && apt-get install -y --no-install-recommends g++ make python3 ca-certificates \ - && cd /app/bundle/programs/server \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $aptMark > /dev/null + +USER rocketchat + +RUN cd /app/bundle/programs/server \ && npm install \ && cd npm/node_modules/isolated-vm \ && npm install \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $aptMark > /dev/null \ - && find /usr/local -type f -executable -exec ldd '{}' ';' \ + && npm cache clear --force + +USER root + +RUN find /usr/local -type f -executable -exec ldd '{}' ';' \ | awk '/=>/ { print $(NF-1) }' \ | sort -u \ | xargs -r dpkg-query --search \ | cut -d: -f1 \ | sort -u \ | xargs -r apt-mark manual \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && npm cache clear --force + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false USER rocketchat