Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker to deploy integration #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . .
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that Copy statement will copy all files in folder no include in .dockerignore


# 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" ]
40 changes: 40 additions & 0 deletions README.md
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add a step by step to run with docker, let me know is clear the information or if i need to add more information

Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,46 @@ client.join(
$ curl <YOU_URL> -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 `<YOU_URL>` with the required parameters:

#### Example Request:

```bash
$ curl <YOU_URL> -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.

<!-- ### Heroku (CLI)

1. If you cloned this repository, you may use the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) to deploy your server. Remember to [set your config vars (envoirnment variables)](https://devcenter.heroku.com/articles/config-vars).
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
},
{
"name": "EkaanshArora"
},
{
"name": "Jose Sarmiento"
}
],
"license": "ISC",
Expand Down