Skip to content

Commit

Permalink
Merge pull request Countly#2182 from kaanklky/master
Browse files Browse the repository at this point in the history
Fix MongoDB service handling for CE Docker builds
  • Loading branch information
ar2rsawseen authored Dec 8, 2021
2 parents de74905 + bc4636b commit f124918
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
mkdir -p /etc/sudoers.d && \
echo "countly ALL=(ALL) NOPASSWD: /usr/bin/sv restart countly-api countly-dashboard" >> /etc/sudoers.d/countly && \
apt-get update && apt-get -y install sudo && \
ln -T /bin/true /usr/bin/systemctl && \
/opt/countly/bin/countly.install.sh && \
rm /usr/bin/systemctl && \
chown -R mongodb:mongodb /var/lib/mongodb && \
\
mkdir /etc/service/mongodb && \
Expand Down
17 changes: 17 additions & 0 deletions bin/countly.install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ apt-get -y install sendmail
#install mongodb
bash "$DIR/scripts/mongodb.install.sh"

if [ "$INSIDE_DOCKER" == "1" ]
then
bash "$DIR/commands/docker/mongodb.sh" &
until mongo --eval "db.stats()" | grep "collections"
do
echo
echo "waiting for MongoDB to allocate files..."
sleep 1
done
sleep 3
fi

bash "$DIR/scripts/detect.init.sh"

#configure and start nginx
Expand Down Expand Up @@ -148,3 +160,8 @@ then
fi

bash "$DIR/scripts/done.sh";

if [ "$INSIDE_DOCKER" == "1" ]
then
kill -2 "$(pgrep mongo)"
fi

0 comments on commit f124918

Please sign in to comment.