-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,7 @@ LABEL maintainer="[email protected]" | |
|
||
ENV LANG=C.UTF-8 | ||
|
||
# `nogroup` group is historically reserved for NFS. | ||
# We don't use any NFS related tools in this image. | ||
# For the same reason of NFS using the gid, we can also use it as long as there are no conflicts in terms of running processes with the same egid (which is 1 in our case). | ||
# While 65533 raw gid could be used, renaming nogroup to rocketchat here for maximum compatibility with older debian image. | ||
# More info on nobody/nogroup - https://wiki.ubuntu.com/nobody | ||
# Debian wiki - https://wiki.debian.org/SystemGroups | ||
# """ | ||
# daemon: Some unprivileged daemons that need to write to files on disk run as daemon.daemon (e.g., portmap, atd, probably others). | ||
# Daemons that don't need to own any files can run as nobody.nogroup instead, | ||
# and more complex or security conscious daemons run as dedicated users. | ||
# The daemon user is also handy for locally installed daemons. | ||
# """ | ||
RUN apk add --no-cache deno ttf-dejavu \ | ||
&& apk add --no-cache --virtual deps shadow python3 make g++ py3-setuptools libc6-compat \ | ||
&& groupmod -n rocketchat nogroup \ | ||
&& useradd -u 65533 -r -g rocketchat rocketchat | ||
|
||
COPY --chown=rocketchat:rocketchat . /app | ||
COPY --chown=65533:65533 . /app | ||
|
||
# needs a mongo instance - defaults to container linking with alias 'mongo' | ||
ENV DEPLOY_METHOD=docker \ | ||
|
@@ -32,29 +15,28 @@ ENV DEPLOY_METHOD=docker \ | |
ROOT_URL=http://localhost:3000 \ | ||
Accounts_AvatarStorePath=/app/uploads | ||
|
||
USER rocketchat | ||
|
||
RUN cd /app/bundle/programs/server \ | ||
&& npm install --omit=dev \ | ||
RUN apk add --no-cache deno ttf-dejavu \ | ||
&& apk add --no-cache --virtual deps shadow python3 make g++ py3-setuptools libc6-compat sudo \ | ||
&& groupmod -n rocketchat nogroup \ | ||
&& useradd -u 65533 -r -g rocketchat rocketchat \ | ||
&& cd /app/bundle/programs/server \ | ||
&& sudo -u rocketchat -g rocketchat npm install --omit=dev \ | ||
&& cd /app/bundle/programs/server \ | ||
&& rm -rf npm/node_modules/sharp \ | ||
&& npm install [email protected] --no-save \ | ||
&& mv node_modules/sharp npm/node_modules/sharp \ | ||
&& sudo -u rocketchat -g rocketchat npm install [email protected] --no-save \ | ||
&& sudo -u rocketchat -g rocketchat mv node_modules/sharp npm/node_modules/sharp \ | ||
# End hack for sharp | ||
&& cd /app/bundle/programs/server/npm/node_modules/@vector-im/matrix-bot-sdk \ | ||
&& npm install \ | ||
&& sudo -u rocketchat -g rocketchat npm install \ | ||
# # Start hack for isolated-vm... | ||
# && rm -rf npm/node_modules/isolated-vm \ | ||
# && npm install [email protected] \ | ||
# && mv node_modules/isolated-vm npm/node_modules/isolated-vm \ | ||
# # End hack for isolated-vm | ||
&& cd /app/bundle/programs/server/npm \ | ||
&& npm rebuild bcrypt --build-from-source \ | ||
&& npm cache clear --force | ||
|
||
USER root | ||
|
||
RUN apk del deps | ||
&& sudo -u rocketchat -g rocketchat npm rebuild bcrypt --build-from-source \ | ||
&& sudo -u rocketchat -g rocketchat npm cache clear --force \ | ||
&& apk del deps | ||
|
||
USER rocketchat | ||
|
||
|