From 45eff56db1d1ca3bb15458456ca039b99c1ac06d Mon Sep 17 00:00:00 2001 From: Daniel Sarmiento Date: Fri, 30 Aug 2024 11:11:08 -0500 Subject: [PATCH 1/4] Configure Docker --- Dockerfile | 11 +++++++++++ package.json | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b37bb72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:latest AS build + +WORKDIR /code + +COPY package.json ./ + +RUN npm install + +COPY . . + +ENTRYPOINT [ "npm", "run", "start" ] diff --git a/package.json b/package.json index 5822bbb..4c19ec1 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,9 @@ }, { "name": "EkaanshArora" + }, + { + "name": "Jose Sarmiento" } ], "license": "ISC", From 9e7e919944619bdb8f5c9bae90a034432af56e99 Mon Sep 17 00:00:00 2001 From: Daniel Sarmiento Date: Sat, 28 Sep 2024 10:08:04 -0500 Subject: [PATCH 2/4] Improve docker file --- Dockerfile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b37bb72..68b39ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,25 @@ -FROM node:latest AS build +# Stage 1: Build +FROM node:16 AS build WORKDIR /code -COPY package.json ./ +# Copy package.json and package-lock.json (if available) +COPY package*.json ./ +# Install dependencies RUN npm install +# Copy the rest of the source code COPY . . -ENTRYPOINT [ "npm", "run", "start" ] +# Set environment variable to ensure NODE_ENV is production +ENV NODE_ENV=production + +# Build the project (if applicable) +# RUN npm run build + +# Expose port (optional, based on application) +# EXPOSE 3000 + +# Use CMD instead of ENTRYPOINT for better flexibility +CMD [ "npm", "run", "start" ] From 9b799d9f969659ec520ebc225c827ecdb2eb9705 Mon Sep 17 00:00:00 2001 From: Daniel Sarmiento Date: Sat, 28 Sep 2024 10:57:37 -0500 Subject: [PATCH 3/4] add docker ignore --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file From 6b7737b8ea04560ec950b608a859d46ff1015418 Mon Sep 17 00:00:00 2001 From: Daniel Sarmiento Date: Sun, 29 Sep 2024 15:59:00 -0500 Subject: [PATCH 4/4] Add | docker information deployment in documentation --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index b367231..54238a8 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,46 @@ client.join( $ curl -X POST -d '{ "sessionName": "Cool Cars", "role": "1", "sessionKey": "session123", "userIdentity": "user123"}' -H "Content-Type: application/json" ``` +### Deploy with Docker + +If you prefer to run the application in a Docker container, follow the steps below. +1. Build the Docker Image: In your terminal, run the following command to build the Docker image: + +``` + docker build -t zoom-videosdk-auth . +``` + +2. Run the Docker Container: Once the image is built, you can run the container while passing in the required environment variables for the Zoom Video SDK credentials: + +```bash +$ docker run -d -p 4000:4000 \ + -e ZOOM_VIDEO_SDK_KEY=your_zoom_videosdk_key \ + -e ZOOM_VIDEO_SDK_SECRET=your_zoom_videosdk_secret \ + --name zoom-videosdk-auth zoom-videosdk-auth +``` + +> This will start the app on port 4000. + +3. Make Requests to the Endpoint: Once the container is running, you can make a POST request to `` with the required parameters: + +#### Example Request: + +```bash +$ curl -X POST -d '{ "sessionName": "Cool Cars", "role": "1", "sessionKey": "session123", "userIdentity": "user123"}' -H "Content-Type: application/json" +``` +Stopping the Docker Container: To stop the Docker container, run: + +```bash +$ docker stop zoom-videosdk-auth +``` +Removing the Docker Container: To remove the container: + +```bash +$ docker rm zoom-videosdk-auth +``` + +Now you can generate your Video SDK JWT. +