File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 1- # Stage 1: Build the React application and backend
2- FROM node:16-alpine AS build-stage
1+ FROM node:16-alpine
32
43WORKDIR /app
5-
6- RUN npm install -g @babel/plugin-proposal-private-property-in-object
7-
8- # Install Node dependencies for backend
4+ RUN npm install -g @babel/cli
95COPY backend/package*.json ./backend/
106RUN npm ci --only=production --prefix backend
117
12- # Copy backend code
13- COPY backend ./backend
8+ COPY backend/ ./backend
149
15- # Install Node dependencies for frontend
1610COPY frontend/package*.json ./frontend/
1711RUN npm ci --only=production --prefix frontend
1812
19- # Copy frontend code
20- COPY frontend ./frontend
21-
22- # Build the React app using react-scripts
23- RUN cd frontend && npm run build && cd ..
24- RUN rm -rf ./frontend/node_modules
13+ COPY frontend/ ./frontend
2514
2615ARG API_BASE_URL
2716ENV API_BASE_URL=${API_BASE_URL}
2817
18+ RUN npm run build --prefix frontend
19+
20+ RUN rm -rf ./frontend/node_modules
21+
2922CMD ["npm" , "start" , "--prefix" , "backend" ]
You can’t perform that action at this time.
0 commit comments