FROM node:22-alpine

WORKDIR /app

# Copy package files first for better caching
COPY apps/canvas/package.json apps/canvas/package-lock.json* ./

# Install dependencies
RUN npm install

# Copy the rest of the application
COPY apps/canvas/ ./

# Expose Vite dev server port
EXPOSE 5173

# Default command (can be overridden in docker-compose)
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
