# Build stage FROM node:20-alpine as build WORKDIR /app # Copy package files and install dependencies COPY package.json package-lock.json ./ RUN npm ci # Copy all files and build the project COPY . . RUN npm run build # Serve stage FROM node:20-alpine as serve WORKDIR /app # Install serve globally RUN npm install -g serve # Copy built files from previous stage COPY --from=build /app/dist ./dist # Expose port and start server EXPOSE 7860 CMD ["serve", "-s", "dist", "-l", "7860"]