From 3319e9fa3616b15411dadeee5eb4abcf2d161068 Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Fri, 4 Oct 2024 16:35:59 -0400 Subject: [PATCH] Add Dockerfile --- Dockerfile | 26 ++++++++++++++++++++++++++ index.js | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..32a9d46 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use an official Node.js runtime as a parent image +FROM node:18-alpine + +# Install Python, make, and g++ to allow native module compilation +RUN apk add --no-cache python3 make g++ + +# Set the working directory inside 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 source code +COPY . . + +# Expose the port your Express app runs on +EXPOSE 3001 + +# Command to run your app +CMD ["npm", "start"] + +# sudo docker build -t emi-backend . +# sudo docker run -d -p 4000:5000 -e PORT=5000 emi-backend \ No newline at end of file diff --git a/index.js b/index.js index 29ec9a9..2632305 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ const webPushEmail = process.env.WEB_PUSH_EMAIL; webPush.setVapidDetails('mailto:' + webPushEmail, publicVapidKey, privateVapidKey); var corsOptions = { - origin: ['http://localhost:8080', "https://social.emmint.com", "https://fellowship.emmint.com"], + origin: ['http://localhost:8080', 'http://localhost:3000', "https://social.emmint.com", "https://fellowship.emmint.com"], credentials: true };