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 7fc2054 commit 7956ca9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ RUN apk add --no-cache mongodb-tools
# Create a directory for MongoDB data and logs
RUN mkdir -p /data/db /var/log/mongodb

# Install OpenRC, which is used to manage system services
RUN apk add --no-cache openrc

# Enable MongoDB to start at boot
RUN rc-update add mongodb default

# Expose the port that your Node.js Express app listens on (e.g., 3000)
EXPOSE 5000

# Start MongoDB and your server
CMD mongod --fork --logpath /var/log/mongodb/mongod.log && node src/index.js
CMD rc-service mongodb start && mongod --fork --logpath /var/log/mongodb/mongod.log && node src/index.js

0 comments on commit 7956ca9

Please sign in to comment.