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; Dockerfile for running inside a container #18

Open
wants to merge 2 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
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:alpine

# Default port is set to 3000.
# This will be overriden if a diffferent value is provided as an argument for the container.
ENV PORT 3000

RUN apk update
RUN apk upgrade
RUN apk add git bash curl wget
RUN rm -rf /var/cache/apk/*

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY package.json /usr/src/app/
RUN npm install && npm cache clean --force
COPY . /usr/src/app

CMD [ "npm", "start" ]
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ video in both the tabs!

![screenshot of chat app](quickstart/public/quickstart.png)

## Using Docker

You need to build a docker image with the dependecies installed.

``` bash
docker build -t video-quickstart-js .
```

Once the image is created, you can run the container by running the `docker run` command. Replace the
variables `$HOST_PORT`, `$PORT`.

``` bash
docker run -it --rm \
-p $HOST_PORT:$PORT \
--env-file .env \
video-quickstart-js:latest
```

Add `-d` as an option for running in daemon mode.
Add `--restart always` options for restarting the container incase of failure or system restart.

## Examples

The project contains some use-case examples for the Twilio Video JS SDK. After running the application
Expand Down