-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd33782
commit f1b4fe8
Showing
1 changed file
with
5 additions
and
3 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,15 +1,17 @@ | ||
ARG image=node:21-alpine3.18 | ||
# First image to compile typescript to javascript | ||
FROM node:20-alpine3.18 AS build-image | ||
FROM ${image} AS build-image | ||
WORKDIR /app | ||
COPY . . | ||
RUN npm ci | ||
RUN npm run clean | ||
RUN npm run build | ||
|
||
# Second image, that creates an image for production | ||
FROM node:20-alpine3.18 AS prod-image | ||
FROM ${image} AS prod-image | ||
WORKDIR /app | ||
COPY --from=build-image ./app/dist ./dist | ||
COPY package* ./ | ||
RUN npm ci --production | ||
CMD [ "node", "./dist/src/index.js" ] | ||
CMD [ "node", "./dist/src/index.js" ] | ||
|