Skip to content

Commit

Permalink
preview dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed Sep 17, 2023
1 parent c50f321 commit 17c6959
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
22 changes: 7 additions & 15 deletions apps/meteor/.docker-mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
ARG MONGO_VERSION=5.0.5

FROM mongo:$MONGO_VERSION

FROM node:14.21.3-bullseye-slim

LABEL maintainer="[email protected]"

# 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 \
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion apps/meteor/.docker-mongo/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 17c6959

Please sign in to comment.