project-knedita/Dockerfile
2023-07-20 08:15:29 -03:00

33 lines
No EOL
448 B
Docker

FROM node:18 as builder
# Create app dir
WORKDIR /app
COPY package*.json ./
COPY prisma ./prisma/
RUN npm install -D @swc/cli @swc/core
RUN npm install
COPY . .
RUN npm run build
# Stage 2
FROM node:18
WORKDIR /app
RUN npm i pm2 -g
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/prisma ./prisma/
COPY --from=builder /app/dist ./dist/
RUN npm ci
RUN npm run prisma:deploy
EXPOSE 8080
CMD ["npm", "run", "prod:start"]