From 634fb585e72b0823b2383d02efae2714a43b2876 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 24 Oct 2024 18:57:23 +0530 Subject: [PATCH] feat: server dockerfile --- Dockerfile.backend | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile.backend diff --git a/Dockerfile.backend b/Dockerfile.backend new file mode 100644 index 00000000..ec5ca679 --- /dev/null +++ b/Dockerfile.backend @@ -0,0 +1,23 @@ +# Use node image +FROM node:18-alpine + +# Set working directory in the container to /app +WORKDIR /app + +# Copy only the package.json and package-lock.json first for caching +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install --production + +# Copy the entire project (core and backend code) +COPY . . + +# Set the working directory to the backend folder +WORKDIR /app/server + +# Expose the port the backend listens on +EXPOSE 8080 + +# Start the backend server +CMD ["npm", "run", "start:server"]