2022-07-01 23:06:50 +03:00
|
|
|
FROM node:16-alpine AS BUILD_IMAGE
|
|
|
|
|
2022-07-02 22:14:07 +03:00
|
|
|
|
2022-07-01 23:06:50 +03:00
|
|
|
# install dependencies
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
# Copy all local files into the image.
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN npx prisma generate
|
|
|
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# remove development dependencies
|
|
|
|
RUN npm prune --production
|
|
|
|
|
|
|
|
FROM node:16-alpine
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=0 /app .
|
|
|
|
|
2022-07-02 22:14:07 +03:00
|
|
|
ENV PORT 8080
|
2022-07-01 23:06:50 +03:00
|
|
|
EXPOSE 8080
|
|
|
|
|
2022-08-10 09:40:17 +03:00
|
|
|
CMD ["node", "./build/src/server.js"]
|