FROM node:18-alpine # Install git-lfs for LFS file support RUN apk add --no-cache git-lfs && git lfs install WORKDIR /app # Copy package files COPY client/package*.json ./client/ COPY server/package*.json ./server/ # Install dependencies RUN cd client && npm install RUN cd server && npm install # Copy source code COPY . . # Build client and server RUN cd client && npm run build RUN cd server && npm run build # Use existing node user (UID 1000 already exists in node:18-alpine) RUN chown -R node:node /app USER node # Hugging Face Spaces uses port 7860, Render/Railway use PORT env ENV PORT=7860 ENV NODE_ENV=production EXPOSE 7860 # Start server (path changed due to rootDir: "..") CMD ["node", "server/dist/server/src/index.js"]