Skip to content

Commit

Permalink
dockerfile written for building docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMohit2003 committed Mar 22, 2024
1 parent 6780fdf commit 8e3651d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

FROM node:16 AS build-stage

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

# Serve the app using Node.js
FROM node:16 AS production-stage

# Install 'serve' to serve the application
RUN npm install -g serve

WORKDIR /app

COPY --from=build-stage /app/dist /app

# Expose the port that 'serve' will run on
EXPOSE 5000

# Command to serve the application on port 5000
CMD ["serve", "-s", ".", "-l", "5000"]

0 comments on commit 8e3651d

Please sign in to comment.