# Stage 1: Build the React app
FROM node:18 as builder

# Set the working directory
WORKDIR /app

# Copy dependency files to leverage Docker's cache
COPY package.json .
COPY package-lock.json .

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the React app for production
RUN npm run build

# Stage 2: Create a minimal container with just the build files
# FROM alpine:latest
# WORKDIR /app
# COPY --from=builder /app/build /app/build
# CMD ["echo", "Build complete"]