From a69731b4ef9e4274f68e180aedaa60e2130cfe07 Mon Sep 17 00:00:00 2001 From: Kristian Matthews-Kennington Date: Mon, 29 Jan 2024 12:00:41 +0000 Subject: [PATCH 1/2] Add Dockerfile for containerization --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f0d0ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an official Node.js runtime as a parent image +FROM node:latest + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json (if available) +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy the project files into the container +COPY . . + +# Build the app using the vercel-build script +RUN npm run vercel-build + +# Expose the port the app runs on +EXPOSE 3000 + +# Define the command to run the app +CMD ["npm", "run", "start"] From 570be02a5e1508867889e1141d5813198d7a8143 Mon Sep 17 00:00:00 2001 From: Kristian Matthews-Kennington Date: Mon, 29 Jan 2024 14:39:37 +0000 Subject: [PATCH 2/2] Add environment variable comment in Dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7f0d0ee..797b2b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ RUN npm install # Copy the project files into the container COPY . . +# Environment variables are expected to be passed at runtime. + # Build the app using the vercel-build script RUN npm run vercel-build