# Use an official Node runtime as the base image FROM node:20 # Set the working directory in the container WORKDIR /app # Copy package.json and package-lock.json to the working directory COPY package*.json ./ # Install project dependencies RUN npm install # Copy the rest of the application code COPY . . # Build the application RUN npm run build # Expose the port the app runs on EXPOSE 4173 # Command to run the application CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0"]