Skip to content

Commit 26b6714

Browse files
committed
updated dockerfile
1 parent 18f1e9b commit 26b6714

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Diff for: Dockerfile

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
# Use Node.js official image
2-
FROM node:18-alpine
1+
# Stage 1: Build
2+
FROM node:18-alpine as build
33

4-
# Set working directory
4+
# Set working dir
55
WORKDIR /app
66

7-
# Copy package.json and install dependencies
8-
COPY package*.json ./
9-
RUN npm install
10-
11-
# Copy the rest of the app
7+
# Copy entire repo
128
COPY . .
139

14-
# Build the React app
10+
# Install workspace dependencies
11+
RUN npm install --legacy-peer-deps
12+
13+
# Build using your monorepo script
1514
RUN npm run build
1615

17-
# Use Nginx to serve the build
16+
# Stage 2: Serve the build output
1817
FROM nginx:alpine
19-
COPY --from=0 /app/build /usr/share/nginx/html
18+
19+
# Copy only the frontend build (adjust path if different)
20+
COPY --from=build /app/packages/react-scripts/build /usr/share/nginx/html
2021

2122
EXPOSE 80
2223
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)