From 17c6959d94a941240c24fd04e6e752d8f280a328 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Mon, 18 Sep 2023 00:46:53 +0530 Subject: [PATCH] preview dockerfile --- apps/meteor/.docker-mongo/Dockerfile | 22 +++++++--------------- apps/meteor/.docker-mongo/entrypoint.sh | 4 +++- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/apps/meteor/.docker-mongo/Dockerfile b/apps/meteor/.docker-mongo/Dockerfile index 037aadf4917f..6f12508a5730 100644 --- a/apps/meteor/.docker-mongo/Dockerfile +++ b/apps/meteor/.docker-mongo/Dockerfile @@ -1,24 +1,14 @@ +ARG MONGO_VERSION=5.0.5 + +FROM mongo:$MONGO_VERSION + FROM node:14.21.3-bullseye-slim LABEL maintainer="buildmaster@rocket.chat" -# Install MongoDB and dependencies -ENV MONGO_MAJOR=5.0 \ - MONGO_VERSION=5.0.5 - RUN set -x \ && apt-get update \ - && apt-get install -y wget gnupg dirmngr pwgen \ - && wget -qO - "https://www.mongodb.org/static/pgp/server-$MONGO_MAJOR.asc" | apt-key add - \ - && echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/$MONGO_MAJOR main" | tee "/etc/apt/sources.list.d/mongodb-org-$MONGO_MAJOR.list" \ - && apt-get update \ - && apt-get install -y \ - mongodb-org=$MONGO_VERSION \ - mongodb-org-server=$MONGO_VERSION \ - mongodb-org-shell=$MONGO_VERSION \ - mongodb-org-mongos=$MONGO_VERSION \ - mongodb-org-tools=$MONGO_VERSION \ - fontconfig \ + && apt-get install -y wget gnupg dirmngr pwgen fontconfig libcurl4 \ && apt-get clean my room \ && groupadd -g 65533 -r rocketchat \ && useradd -u 65533 -r -g rocketchat rocketchat \ @@ -45,6 +35,8 @@ RUN aptMark="$(apt-mark showmanual)" \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && npm cache clear --force +COPY --from=0 /usr/bin/mongo* /usr/bin + VOLUME /app/uploads WORKDIR /app/bundle diff --git a/apps/meteor/.docker-mongo/entrypoint.sh b/apps/meteor/.docker-mongo/entrypoint.sh index 0568da462bf3..d132b63db6e3 100644 --- a/apps/meteor/.docker-mongo/entrypoint.sh +++ b/apps/meteor/.docker-mongo/entrypoint.sh @@ -39,7 +39,9 @@ echo """ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═══╝ ╚═╝╚══════╝ ╚══╝╚══╝ """ -mongod --fork --replSet rs0 --config /etc/mongod.conf +mkdir /data/db -p + +mongod --fork --replSet rs0 --dbpath /data/db -logpath /var/log/mongod.log until mongo --eval "db" &> /dev/null; do echo "MongoDB still not ready, sleeping"