Skip to content

Refactor docker #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ RUN apt-get update && \
# Install yarn globally
RUN npm install -g yarn

# Clone the repository
RUN git clone https://github.com/hppanpaliya/React-TrashMail
# Install pm2 globally
RUN npm install -g pm2

# Install dependencies for the React project
# Copy in package.json files and run install to allow docker to cache themc
COPY react/package.json /React-TrashMail/react/
WORKDIR /React-TrashMail/react
RUN yarn


# Install dependencies for the mailserver
COPY mailserver/package.json /React-TrashMail/mailserver/
WORKDIR /React-TrashMail/mailserver
RUN yarn

# Install pm2 globally
RUN npm install -g pm2
COPY . /React-TrashMail

# Define mountable volume
VOLUME ["/React-TrashMail/mailserver/attachments"]
Expand Down
2 changes: 1 addition & 1 deletion docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ fi

# Start the application
cd /React-TrashMail/mailserver
pm2-runtime start yarn -- start
PM2_HOME=/React-Trashmail/mailserver pm2-runtime start yarn -- start:docker
1 change: 1 addition & 0 deletions mailserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"start": "nodemon server.js",
"start:docker": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand Down