-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5f7f9b
commit b5b801e
Showing
1 changed file
with
29 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,29 @@ | ||
# Use Node.js LTS version as base image | ||
FROM node:14-alpine as builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package.json package-lock.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install --silent | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Stage 2: Production environment | ||
FROM nginx:alpine | ||
|
||
# Copy build files from the builder stage to nginx | ||
COPY --from=builder /app/build /usr/share/nginx/html | ||
|
||
# Expose port 80 | ||
EXPOSE 80 | ||
|
||
# Start nginx server | ||
CMD ["nginx", "-g", "daemon off;"] |