Add Dockerfile
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -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
|
||||||
2
index.js
2
index.js
@@ -15,7 +15,7 @@ const webPushEmail = process.env.WEB_PUSH_EMAIL;
|
|||||||
webPush.setVapidDetails('mailto:' + webPushEmail, publicVapidKey, privateVapidKey);
|
webPush.setVapidDetails('mailto:' + webPushEmail, publicVapidKey, privateVapidKey);
|
||||||
|
|
||||||
var corsOptions = {
|
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
|
credentials: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user