🚧 Dockerfile changes
This commit is contained in:
parent
32cdeced8e
commit
83d3e4f150
1 changed files with 11 additions and 19 deletions
30
Dockerfile
30
Dockerfile
|
@ -1,32 +1,24 @@
|
||||||
FROM node:19 AS builder
|
FROM node:19 AS builder
|
||||||
|
|
||||||
WORKDIR /usr
|
# Create app directory
|
||||||
|
WORKDIR /app
|
||||||
COPY tsconfig.json ./
|
|
||||||
|
|
||||||
COPY src ./src
|
|
||||||
|
|
||||||
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
COPY prisma ./prisma/
|
COPY prisma ./prisma/
|
||||||
|
|
||||||
RUN ls -a
|
# Install app dependencies
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
## this is stage two , where the app actually runs
|
|
||||||
|
|
||||||
FROM node:19
|
FROM node:19
|
||||||
|
|
||||||
WORKDIR /usr
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/package*.json ./
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
COPY --from=builder /usr/package*.json ./
|
CMD [ "npm", "run", "start:prod" ]
|
||||||
|
|
||||||
COPY --from=builder /usr/dist ./dist
|
|
||||||
|
|
||||||
RUN npm install --omit=dev
|
|
||||||
|
|
||||||
CMD ["node","dist/index.js"]
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue