-
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.
chore!: Change default Docker flavor to Alpine (#28042)
Co-authored-by: Guilherme Gazzo <[email protected]>
- Loading branch information
1 parent
e3dac4a
commit 274a89b
Showing
7 changed files
with
117 additions
and
113 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
|
||
Changes the default base Docker image to Alpine. Previously we were shipping Alpine as an alternative flavor under the tag rocketchat/rocket.chat:{release}.alpine , we have been testing this for a while now so we're migrating to use the official one to Alpine. | ||
|
||
We'll still ship a Debian variant under the tag rocketchat/rocket.chat:{release}.debian. |
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
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
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
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 |
---|---|---|
@@ -1,25 +1,14 @@ | ||
ARG DENO_VERSION="1.37.1" | ||
|
||
FROM denoland/deno:bin-${DENO_VERSION} as deno | ||
|
||
FROM node:20.17.0-bullseye-slim | ||
FROM node:20.17.0-alpine3.20 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
# dependencies | ||
RUN groupadd -g 65533 -r rocketchat \ | ||
&& useradd -u 65533 -r -g rocketchat rocketchat \ | ||
&& mkdir -p /app/uploads \ | ||
&& chown rocketchat:rocketchat /app/uploads \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends fontconfig | ||
ENV LANG=C.UTF-8 | ||
|
||
COPY --from=deno /deno /bin/deno | ||
RUN apk add --no-cache deno ttf-dejavu | ||
|
||
# --chown requires Docker 17.12 and works only on Linux | ||
ADD --chown=rocketchat:rocketchat . /app | ||
ADD . /app | ||
|
||
# needs a mongoinstance - defaults to container linking with alias 'mongo' | ||
# needs a mongo instance - defaults to container linking with alias 'mongo' | ||
ENV DEPLOY_METHOD=docker \ | ||
NODE_ENV=production \ | ||
MONGO_URL=mongodb://mongo:27017/rocketchat \ | ||
|
@@ -28,25 +17,24 @@ ENV DEPLOY_METHOD=docker \ | |
ROOT_URL=http://localhost:3000 \ | ||
Accounts_AvatarStorePath=/app/uploads | ||
|
||
RUN aptMark="$(apt-mark showmanual)" \ | ||
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates \ | ||
RUN set -x \ | ||
&& apk add --no-cache --virtual .fetch-deps python3 make g++ py3-setuptools libc6-compat \ | ||
&& 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 '{}' ';' \ | ||
| 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 | ||
|
||
USER rocketchat | ||
&& npm install --omit=dev --unsafe-perm \ | ||
# Start hack for sharp... | ||
&& rm -rf npm/node_modules/sharp \ | ||
&& npm install [email protected] \ | ||
&& mv node_modules/sharp npm/node_modules/sharp \ | ||
# End hack for sharp | ||
# # 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 \ | ||
&& apk del .fetch-deps | ||
|
||
VOLUME /app/uploads | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
ARG DENO_VERSION="1.37.1" | ||
|
||
FROM denoland/deno:bin-${DENO_VERSION} as deno | ||
|
||
FROM node:20.17.0-bullseye-slim | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
# dependencies | ||
RUN groupadd -g 65533 -r rocketchat \ | ||
&& useradd -u 65533 -r -g rocketchat rocketchat \ | ||
&& mkdir -p /app/uploads \ | ||
&& chown rocketchat:rocketchat /app/uploads \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends fontconfig | ||
|
||
COPY --from=deno /deno /bin/deno | ||
|
||
# --chown requires Docker 17.12 and works only on Linux | ||
ADD --chown=rocketchat:rocketchat . /app | ||
|
||
# needs a mongoinstance - defaults to container linking with alias 'mongo' | ||
ENV DEPLOY_METHOD=docker \ | ||
NODE_ENV=production \ | ||
MONGO_URL=mongodb://mongo:27017/rocketchat \ | ||
HOME=/tmp \ | ||
PORT=3000 \ | ||
ROOT_URL=http://localhost:3000 \ | ||
Accounts_AvatarStorePath=/app/uploads | ||
|
||
RUN aptMark="$(apt-mark showmanual)" \ | ||
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates \ | ||
&& 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 '{}' ';' \ | ||
| 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 | ||
|
||
USER rocketchat | ||
|
||
VOLUME /app/uploads | ||
|
||
WORKDIR /app/bundle | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "main.js"] |