-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockerfile written for building docker image
- Loading branch information
1 parent
6780fdf
commit 8e3651d
Showing
1 changed file
with
28 additions
and
0 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 |
---|---|---|
@@ -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"] |