# Use the official Node.js image as the base image
FROM node:22-alpine

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application
COPY . .

# Build Storybook
RUN npm run build-storybook

# Expose the port Storybook will run on
EXPOSE 6006

# Serve Storybook
CMD ["npx", "http-server", "storybook-static"]
