cats / Dockerfile
Riddwam's picture
Rename dockerfile to Dockerfile
e158256 verified
Raw History Blame Contribute Delete
750 Bytes
# Use a base image with Node.js installed
FROM node:20-slim
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json (if you have one) first
# to leverage Docker cache. This installs dependencies before copying
# the rest of the source code.
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application source code
COPY . .
# Run the build command
RUN npm run build
# Install a simple static file server globally
RUN npm install -g serve
# Expose the port the server will run on (Hugging Face defaults to 7860 for Docker)
EXPOSE 7860
# Command to run the static file server, serving the build output (dist directory)
CMD [ "serve", "-s", "dist", "-l", "7860" ]