-
Notifications
You must be signed in to change notification settings - Fork 16
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 #42 from SheershBhatnagar/main
chore(docker): Modified the Dockerfile
- Loading branch information
Showing
1 changed file
with
12 additions
and
18 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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
# Builder already added via Github Actions | ||
# Uncomment for full workflow action | ||
# FROM node:slim as build-stage | ||
# ENV NODE_OPTIONS=--openssl-legacy-provider | ||
# WORKDIR /app | ||
# COPY package.json ./ | ||
# COPY package-lock.json ./ | ||
# COPY . . | ||
# RUN npm ci --force | ||
# RUN npm run build | ||
# FROM nginx:stable-alpine | ||
# COPY --from=build-stage /app/build/ /usr/share/nginx/html | ||
# EXPOSE 80 | ||
# CMD ["nginx", "-g", "daemon off;"] | ||
FROM node:16-slim as builder | ||
|
||
FROM node:16-slim | ||
WORKDIR /app | ||
COPY build/ ./build/ | ||
|
||
COPY . . | ||
|
||
RUN npm ci --force | ||
RUN npm run build | ||
|
||
FROM nginx:alpine-slim | ||
|
||
COPY --from=builder /app/build/ /usr/share/nginx/html | ||
|
||
EXPOSE 80 | ||
RUN npm install -g serve | ||
CMD ["serve", "-s", "build", "-p", "80"] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |