Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kallyas authored Aug 26, 2023
1 parent 0d1e243 commit c295a4d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit c295a4d

Please sign in to comment.