FROM node:20-alpine

# Create app directory
WORKDIR /app

# Copy shared module first (as a sibling to client)
COPY shared ./shared

# Setup Client directory
WORKDIR /app/client

# Install dependencies
COPY client/package*.json ./
RUN npm install

# Copy client source code
COPY client/ .

# Expose port
EXPOSE 3000

# Run Next.js in dev mode
CMD ["npx", "next", "dev"]
