Skip to content

Commit

Permalink
Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hppanpaliya committed Nov 12, 2023
1 parent 8f29c02 commit 0023323
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Start with the official MongoDB image
FROM mongo:latest

# Install Node.js
RUN apt-get update && \
apt-get install -y curl gnupg && \
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs

# Clone the repository
RUN git clone https://github.com/hppanpaliya/React-TrashMail

# Build the React project
WORKDIR /React-TrashMail/react
RUN yarn && \
yarn run build

# Install dependencies for the mailserver
WORKDIR /React-TrashMail/mailserver
RUN yarn

# Install pm2 globally
RUN npm install -g pm2

# Define mountable volume
VOLUME ["/React-TrashMail/mailserver/attachments"]

# Set the command to start MongoDB and the mail server
CMD ["sh", "-c", "rc-service mongodb start && pm2-runtime start yarn -- start"]

0 comments on commit 0023323

Please sign in to comment.