project-knedita/Dockerfile

33 lines
448 B
Text
Raw Normal View History

FROM node:18 as builder
2023-06-20 20:05:15 +00:00
# Create app dir
WORKDIR /app
COPY package*.json ./
COPY prisma ./prisma/
RUN npm install -D @swc/cli @swc/core
2023-06-20 20:05:15 +00:00
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
2023-07-20 11:15:29 +00:00
RUN npm run prisma:deploy
2023-06-20 20:05:15 +00:00
EXPOSE 8080
CMD ["npm", "run", "prod:start"]