-
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.
config(pipeline): export running port
- Loading branch information
quytranDF
committed
Sep 8, 2024
1 parent
d53a16d
commit b277d06
Showing
1 changed file
with
26 additions
and
24 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,24 +1,26 @@ | ||
FROM node:16-alpine as build | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci | ||
|
||
COPY --chown=node:node . . | ||
RUN npm run build | ||
|
||
# Running `npm ci` removes the existing node_modules directory and passing in --only=production ensures that only the production dependencies are installed. This ensures that the node_modules directory is as optimized as possible | ||
RUN npm ci --only=production && npm cache clean --force | ||
|
||
USER node | ||
|
||
FROM node:16-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build --chown=node:node /app/package*.json ./ | ||
COPY --from=build --chown=node:node /app/node_modules ./node_modules | ||
COPY --from=build --chown=node:node /app/dist ./dist | ||
|
||
CMD ["node", "dist/main.js"] | ||
FROM node:16-alpine as build | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci | ||
|
||
COPY --chown=node:node . . | ||
RUN npm run build | ||
|
||
# Running `npm ci` removes the existing node_modules directory and passing in --only=production ensures that only the production dependencies are installed. This ensures that the node_modules directory is as optimized as possible | ||
RUN npm ci --only=production && npm cache clean --force | ||
|
||
USER node | ||
|
||
FROM node:16-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build --chown=node:node /app/package*.json ./ | ||
COPY --from=build --chown=node:node /app/node_modules ./node_modules | ||
COPY --from=build --chown=node:node /app/dist ./dist | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "dist/main.js"] |