project-knedita/Dockerfile

31 lines
421 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-06-20 20:05:15 +00:00
EXPOSE 8080
CMD ["npm", "run", "prod:start"]