Skip to content

Commit 8e3651d

Browse files
committed
dockerfile written for building docker image
1 parent 6780fdf commit 8e3651d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
FROM node:16 AS build-stage
3+
4+
WORKDIR /app
5+
6+
COPY package*.json ./
7+
8+
RUN npm install
9+
10+
COPY . .
11+
12+
RUN npm run build
13+
14+
# Serve the app using Node.js
15+
FROM node:16 AS production-stage
16+
17+
# Install 'serve' to serve the application
18+
RUN npm install -g serve
19+
20+
WORKDIR /app
21+
22+
COPY --from=build-stage /app/dist /app
23+
24+
# Expose the port that 'serve' will run on
25+
EXPOSE 5000
26+
27+
# Command to serve the application on port 5000
28+
CMD ["serve", "-s", ".", "-l", "5000"]

0 commit comments

Comments
 (0)