Skip to content

Commit

Permalink
feat: dockerfile prod fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rathod-sahaab committed Apr 21, 2024
1 parent 792cc4c commit dead394
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 79 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ nodemon*.json
# Node Files
node_modules
npm-debug.log
npm-debug.log.*
npm-debug.log.*

13 changes: 6 additions & 7 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM node:16.14-alpine As development
FROM node:20-alpine As development

RUN npm install -g pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app

COPY package.json ./
COPY pnpm-lock.yaml ./

RUN pnpm install
RUN pnpm install --frozen-lockfile

COPY . .

RUN ls -a

RUN pnpm prisma generate
RUN pnpm run build
RUN pnpm run prisma:generate && pnpm run build

CMD ["node", "dist/main.js"]
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"prisma:generate": "prisma generate",
"migrate:deploy": "prisma migrate deploy",
"prod:docker": "yarn && prisma generate && yarn nest build && node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand All @@ -36,7 +36,7 @@
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-fastify": "^9.0.9",
"@nestjs/terminus": "^9.1.1",
"@prisma/client": "^4.2.1",
"@prisma/client": "^4.16.2",
"@sendgrid/mail": "^7.7.0",
"@types/ms": "^0.7.31",
"argon2": "^0.28.7",
Expand All @@ -53,7 +53,7 @@
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"prisma": "^4.2.1",
"prisma": "^4.16.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.5.6",
"tmp": "^0.2.1",
Expand Down
Loading

0 comments on commit dead394

Please sign in to comment.