Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

Commit

Permalink
Split build for persistence into two stages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinrany committed Mar 25, 2021
1 parent e5b8cfa commit b65aea0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions persistence/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
FROM node:14-alpine
FROM node:14-alpine AS build
WORKDIR /app

COPY package.json pnpm-lock.yaml tsconfig.json ./
RUN npx pnpm --prod --frozen-lockfile install

COPY prisma prisma/
COPY src src/
RUN npx --no-install prisma generate

COPY src src/
RUN npm run esbuild


FROM node:14-alpine
WORKDIR /app

COPY --from=build /app/dist/main.js .

VOLUME /config/config.json

ENTRYPOINT ["node", "dist/main.js"]
ENTRYPOINT ["node", "main.js"]

0 comments on commit b65aea0

Please sign in to comment.