-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added multistage build and changed compose file
- Loading branch information
1 parent
c328595
commit 53e9e6e
Showing
2 changed files
with
41 additions
and
21 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,13 +1,23 @@ | ||
FROM node:18 | ||
# Stage 1: Build stage | ||
FROM node:18-alpine AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
|
||
# Stage 2: Production stage | ||
|
||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
copy --from= build /app . | ||
|
||
EXPOSE 4040 | ||
|
||
CMD [ "npm","start" ] | ||
CMD["npm","start"] |
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