Skip to content

Commit

Permalink
chore: npm install as rocketchat user (#33726)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Sampaio <[email protected]>
  • Loading branch information
ggazzo and sampaiodiego committed Oct 23, 2024
1 parent c683a41 commit 0649a67
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions apps/meteor/.docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0649a67

Please sign in to comment.