From 4bdf1ecbeb44ef5773d181788d7abed4897e064b Mon Sep 17 00:00:00 2001 From: Vivek barnwal Date: Thu, 4 Jul 2024 16:42:13 +0530 Subject: [PATCH] fix #1: Dockerfile added --- .dockerignore | 6 ++++++ Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2ed73f1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +.next +.dockerignore +Dockerfile +.dockerignore + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c89926 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Use an official Node.js version as a parent image +FROM node:18-alpine + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application code to the working directory +COPY . . + +# Build the Next.js application +RUN npm run build + +# Expose the port Next.js runs on +EXPOSE 3000 + +# Start the Next.js application +CMD ["npm", "start"] +