Dockerfile 480 B

1234567891011121314151617181920212223242526
  1. # Use an official Node.js runtime as a parent image
  2. FROM node:20-alpine
  3. # Set the working directory in the container
  4. WORKDIR /app
  5. # Copy package.json and package-lock.json to the working directory
  6. COPY package*.json ./
  7. # Install any needed packages
  8. RUN npm install
  9. # Bundle app source
  10. COPY . .
  11. # Build the app
  12. RUN npm run build
  13. # Install serve to run the app
  14. RUN npm install -g serve
  15. # Expose the port the app runs on
  16. EXPOSE 3000
  17. # Run the app
  18. CMD ["serve", "-s", "dist"]