Skip to content

Commit

Permalink
docker-6
Browse files Browse the repository at this point in the history
  • Loading branch information
Wissaladd committed Dec 21, 2023
1 parent 8103570 commit 6b39fb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
FROM node:18.18.0 as build
RUN yarn global add pm2
FROM node:18-alpine
RUN npm install pm2 yarn @nestjs/cli -g --force
WORKDIR /app
COPY package*.json ./
RUN yarn install
RUN yarn install --production
COPY . .
RUN yarn build

FROM node:18.18.0
WORKDIR /app
COPY --from=build /app/dist ./dist
RUN yarn install

CMD [ "pm2-runtime", "dist/main" ]
EXPOSE 3000
CMD ["yarn","pm2:start:app"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"pm2:deploy:app": "yarn build && pm2 start app.json",
"pm2:start:app": "pm2 start app.json",
"pm2:start:app": "pm2-runtime start app.json",
"pm2:stop:app": "pm2 stop app.json",
"pm2:destroy:app": "pm2 delete app.json"
},
Expand Down

0 comments on commit 6b39fb6

Please sign in to comment.