From 629bd7e4f2162868e9ca5380235ff447767f2c43 Mon Sep 17 00:00:00 2001 From: donavon04 Date: Tue, 17 Dec 2024 17:11:20 -0700 Subject: [PATCH] added some stuff! --- backend/.env | 2 -- backend/Dockerfile | 22 ++++++++++++++++++++++ frontend/Dockerfile | 15 +++++++++++++++ frontend/example.env | 5 ----- 4 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 backend/Dockerfile create mode 100644 frontend/Dockerfile delete mode 100644 frontend/example.env diff --git a/backend/.env b/backend/.env index bc8fa04..28c7371 100644 --- a/backend/.env +++ b/backend/.env @@ -1,7 +1,5 @@ MONGODB_URI='mongodb://localhost:27017' MONGODB_NAME='docucenter' - NODE_ENV='development' #If set to production it will require https to function - JWT_SECRET='IjkAORBx^cLYpSb6Btz@te&vAJ3Pt*$z' diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..45fd31e --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,22 @@ +# Use the official Node.js 14 image as the base image +FROM node:21.4-alpine + +# Set the working directory inside the container +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy the project files to the working directory +COPY . ./ + +# Expose port 3000 for the Node.js application +EXPOSE 3000 + +WORKDIR /app + +# Start the Node.js application +CMD [ "node", "server.js" ] \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..f8971a3 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,15 @@ +FROM node:latest +WORKDIR /app + +# Copy .npmrc file to the container +COPY .npmrc ./ + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD [ "node", "build" ] \ No newline at end of file diff --git a/frontend/example.env b/frontend/example.env deleted file mode 100644 index baae485..0000000 --- a/frontend/example.env +++ /dev/null @@ -1,5 +0,0 @@ -TIPTAP_PRO_TOKEN='uCNZ0C3gFH2+0yWa5uSbw9oM+lcXMDwGkPEFudU4ONOKC2m/TH5weVx4lU2EEDpD' - -AUTH_SECRET="txvHsSGbEuQ6j3I3YZEyXkVJnPTP/s5vdK4+OJ8sxQo=" # Added by `npx auth`. Read more: https://cli.authjs.dev - -PUBLIC_BASE_URL='http://localhost:3000/api' #This is the address of the backend