Skip to content

Commit

Permalink
Merge branch 'dev' into 735-rxfill
Browse files Browse the repository at this point in the history
  • Loading branch information
avirgulto authored Sep 9, 2024
2 parents 77c379d + 56d2bed commit b821a90
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ ENV NODE_ENV production

WORKDIR /home/node/app
COPY --chown=node:node . .
RUN npm install -g typescript

WORKDIR /home/node/app/backend
RUN npm install
RUN npm link typescript

WORKDIR /home/node/app/frontend
RUN npm install
RUN npm link typescript

WORKDIR /home/node/app

RUN npm install pm2 -g
# RUN npm install pm2 -g

EXPOSE 5050
EXPOSE 5051

CMD [ "pm2-docker", "pm2.config.js" ]
CMD ./dockerRunnerProd.sh
6 changes: 6 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ FROM node:14-alpine

WORKDIR /home/node/app
COPY --chown=node:node . .
RUN npm install -g typescript

WORKDIR /home/node/app/backend
RUN npm install
RUN npm link typescript

WORKDIR /home/node/app/frontend
RUN npm install
RUN npm link typescript

WORKDIR /home/node/app

EXPOSE 5050
Expand Down
14 changes: 14 additions & 0 deletions dockerRunnerProd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

cd frontend
npm install
( npm run start ) & SERVER_PID=$!

cd ../backend
npm install
( npm run start ) & BACKEND_SERVER_PID=$!

# Handle application background process exiting
wait $SERVER_PID $BACKEND_SERVER_PID
EXIT_CODE=$?
echo "application exited with exit code $EXIT_CODE..."

0 comments on commit b821a90

Please sign in to comment.