changed ports for docker file and added build and production stage
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
FROM node:20-alpine
|
# Build Stage
|
||||||
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production Stage
|
||||||
|
FROM nginx:stable-alpine AS production
|
||||||
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
EXPOSE 5001
|
EXPOSE 5001
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
CMD ["npm", "start"]
|
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
FROM node:20-alpine
|
# Build Stage
|
||||||
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production Stage
|
||||||
|
FROM nginx:stable-alpine AS production
|
||||||
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
EXPOSE 5003
|
EXPOSE 5003
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
CMD ["npm", "start"]
|
|
||||||
|
Reference in New Issue
Block a user