-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from TheMohit2003/docker
dockerfile written for building docker image
- Loading branch information
Showing
2 changed files
with
62 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
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,29 @@ | ||
FROM node:lts AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
# Run build as per the script defined in package.json | ||
RUN npm run build | ||
|
||
# Production stage using a minimal Node.js image | ||
FROM node:alpine AS production-stage | ||
|
||
# Install 'serve' to serve the application | ||
RUN npm install -g serve | ||
|
||
WORKDIR /app | ||
|
||
# Copy the built application from the build stage | ||
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"] |