File tree 1 file changed +12
-11
lines changed
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 1
- # Use Node.js official image
2
- FROM node:18-alpine
1
+ # Stage 1: Build
2
+ FROM node:18-alpine as build
3
3
4
- # Set working directory
4
+ # Set working dir
5
5
WORKDIR /app
6
6
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
12
8
COPY . .
13
9
14
- # Build the React app
10
+ # Install workspace dependencies
11
+ RUN npm install --legacy-peer-deps
12
+
13
+ # Build using your monorepo script
15
14
RUN npm run build
16
15
17
- # Use Nginx to serve the build
16
+ # Stage 2: Serve the build output
18
17
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
20
21
21
22
EXPOSE 80
22
23
CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments