diff --git a/server/Dockerfile b/server/Dockerfile index d4c0f88..0005816 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -11,8 +11,14 @@ RUN apt-get update && apt-get install -y \ g++ \ && rm -rf /var/lib/apt/lists/* +# Add the MongoDB repository key +RUN wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - + +# Add the MongoDB repository to APT sources +RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list + # Install MongoDB and MongoDB tools -RUN apt-get update && apt-get install -y mongodb +RUN apt-get update && apt-get install -y mongodb-org # Create a directory for MongoDB data and logs RUN mkdir -p /data/db /var/log/mongodb @@ -32,7 +38,7 @@ EXPOSE 5000 RUN apt-get update && apt-get install -y systemd # Enable MongoDB to start at boot -RUN systemctl enable mongodb +RUN systemctl enable mongod # Start MongoDB and your server -CMD systemctl start mongodb && node src/index.js +CMD systemctl start mongod && node src/index.js