File size: 575 Bytes
bcce6d0
 
 
 
 
 
cc71218
 
 
 
bcce6d0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Stage 1: Build React Client
FROM node:18-alpine as client-build
WORKDIR /app/client
COPY client/package*.json ./
RUN npm install
COPY client/ ./

# --- DEBUG STEP: Print all files to logs ---
RUN echo "=== FILE LISTING START ===" && ls -R && echo "=== FILE LISTING END ==="

RUN npm run build

# Stage 2: Production Server
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY server/ ./server/
# Move built client to server's public folder
COPY --from=client-build /app/client/dist ./public

ENV PORT=7860
EXPOSE 7860
CMD ["node", "server/index.js"]