Skip to content

Commit 7fd08f6

Browse files
chore: streamline Dockerfile by removing unnecessary comments and installing babel/cli
1 parent 7990884 commit 7fd08f6

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

Dockerfile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# Stage 1: Build the React application and backend
2-
FROM node:16-alpine AS build-stage
1+
FROM node:16-alpine
32

43
WORKDIR /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
95
COPY backend/package*.json ./backend/
106
RUN 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
1610
COPY frontend/package*.json ./frontend/
1711
RUN 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

2615
ARG API_BASE_URL
2716
ENV API_BASE_URL=${API_BASE_URL}
2817

18+
RUN npm run build --prefix frontend
19+
20+
RUN rm -rf ./frontend/node_modules
21+
2922
CMD ["npm", "start", "--prefix", "backend"]

0 commit comments

Comments
 (0)