-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOL-358/PICT-242: update docker file
- Loading branch information
1 parent
e759709
commit 475a367
Showing
1 changed file
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
FROM node:18-alpine AS builder | ||
|
||
WORKDIR /processor | ||
WORKDIR /app | ||
|
||
COPY ./processor . | ||
COPY ./processor/package*.json ./ | ||
|
||
RUN npm install --production --frozen-lockfile | ||
|
||
RUN npm install | ||
COPY ./processor . | ||
|
||
RUN npm run build | ||
|
||
FROM node:18-alpine AS runner | ||
|
||
WORKDIR /processor | ||
WORKDIR /app | ||
|
||
COPY --from=builder /processor . | ||
# Copy only the necessary built files from the builder stage | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package*.json ./ | ||
|
||
EXPOSE 8080 | ||
|
||
CMD [ "npm", "run", "start" ] | ||
ENV NODE_ENV=production | ||
|
||
CMD ["npm", "run", "start"] | ||
|
||
# Metadata | ||
LABEL org.opencontainers.image.authors="Mollie B.V. <[email protected]>" \ | ||
copyright="Copyright (c) 2024 Mollie B.V. All rights reserved." |