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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68b39ba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Stage 1: Build +FROM node:16 AS build + +WORKDIR /code + +# 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 . . + +# 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" ] 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. +