File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1- FROM node:16-alpine
1+ FROM node:16-alpine AS build-stage
22
33WORKDIR /app
4+
45RUN npm install -g @babel/cli
56COPY backend/package*.json ./backend/
67RUN npm ci --only=production --prefix backend
78
8- COPY backend/ ./backend
9+ COPY backend ./backend
10+ RUN npm run build --prefix backend
911
1012COPY frontend/package*.json ./frontend/
1113RUN npm ci --only=production --prefix frontend
1214
13- COPY frontend/ ./frontend
15+ COPY frontend ./frontend
16+ RUN npm run build --prefix frontend
1417
1518ARG API_BASE_URL
1619ENV API_BASE_URL=${API_BASE_URL}
@@ -19,4 +22,6 @@ RUN npm run build --prefix frontend
1922
2023RUN rm -rf ./frontend/node_modules
2124
25+ COPY ./frontend/build /usr/share/nginx/html
26+
2227CMD ["npm" , "start" , "--prefix" , "backend" ]
Original file line number Diff line number Diff line change 2121 },
2222 "scripts" : {
2323 "start" : " react-scripts start" ,
24- "build" : " babel src -d build" ,
24+ "build" : " react-scripts build" ,
2525 "test" : " react-scripts test" ,
2626 "eject" : " react-scripts eject"
2727 },
You can’t perform that action at this time.
0 commit comments