diff --git a/Dockerfile b/Dockerfile index aaa64f2..78d5a6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,26 @@ +# Use an official Node.js runtime as a parent image FROM node:18-alpine +# Set the working directory WORKDIR /app -COPY package.json . +# Copy package.json and package-lock.json +COPY package*.json ./ +# Install dependencies RUN npm install -RUN npm install -g serve + +# Copy the rest of the application code COPY . . + +# Build the application RUN npm run build -EXPOSE 3000 +# Install a lightweight web server +RUN npm install -g serve -CMD ["serve", "-s", "dist", "-l", "3000"] \ No newline at end of file +# Set the command to run the web server +CMD ["serve", "-s", "dist"] + +# Expose the port the app runs on +EXPOSE 3000 \ No newline at end of file