Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
saranshbalyan-1234 committed Sep 18, 2024
1 parent 067e65e commit 7ace137
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
FROM node:20

# Create app directory
WORKDIR /usr/src/app

ENV PORT 8080
FROM node:20 AS build-env
COPY . /app
WORKDIR /app
ENV NODE_ENV production

# Install app dependencies
COPY /package*.json ./
RUN npm ci
# RUN npm install pm2 -g

# Bundle app source
COPY . ./

FROM gcr.io/distroless/nodejs20-debian12
COPY --from=build-env /app /app
WORKDIR /app
ENV PORT 8080
ENV NODE_ENV production
EXPOSE 8080

#scaling
# CMD ["pm2-runtime", "index.js", "-i","-0"]
CMD [ "npm","start" ]
CMD ["index.js"]

0 comments on commit 7ace137

Please sign in to comment.