From a1def0931c245d1fb14e0b240e21140b3609b904 Mon Sep 17 00:00:00 2001 From: Newnius Date: Thu, 4 Jun 2020 17:25:55 +0800 Subject: [PATCH] add zipcall --- zipcall/Dockerfile | 15 +++++++++++++++ zipcall/README.md | 30 ++++++++++++++++++++++++++++++ zipcall/bootstrap.sh | 11 +++++++++++ 3 files changed, 56 insertions(+) create mode 100644 zipcall/Dockerfile create mode 100644 zipcall/README.md create mode 100755 zipcall/bootstrap.sh diff --git a/zipcall/Dockerfile b/zipcall/Dockerfile new file mode 100644 index 0000000..25eb4e8 --- /dev/null +++ b/zipcall/Dockerfile @@ -0,0 +1,15 @@ +FROM node:13-alpine + +MAINTAINER Newnius + +RUN apk --no-cache add git + +RUN git clone https://github.com/ianramzy/decentralized-video-chat.git /zipcall + +RUN cd /zipcall && npm install + +ADD bootstrap.sh /etc/bootstrap.sh + +WORKDIR /zipcall + +CMD ["/etc/bootstrap.sh"] diff --git a/zipcall/README.md b/zipcall/README.md new file mode 100644 index 0000000..32b007f --- /dev/null +++ b/zipcall/README.md @@ -0,0 +1,30 @@ +# Dockered Zipcall + +## What is `Zipcall` + + +Documents: [Zipcall](https://github.com/ianramzy/decentralized-video-chat) + +Demo: [Zipcall](https://zipcall.io) + +## How to setup + +1. Sign up for free twilio account https://www.twilio.com/login +2. Get your Account SID and Auth Token from the Twillio console +3. Create a docker service using the following command +4. View http://localhost:3000 to see your running video chat service + +``` +docker service create \ + --name zipcall \ + --replicas 1 \ + --publish 3000:3000 \ + --env TWILIO_ACCOUNT_SID="SID" \ + --env LOCAL_AUTH_TOKEN="Token" \ + --mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly \ + newnius/zipcall +``` + +## Notice + +_This command creates a docker swarm service, you can use `docker run ...` instead in your way_ diff --git a/zipcall/bootstrap.sh b/zipcall/bootstrap.sh new file mode 100755 index 0000000..27816dd --- /dev/null +++ b/zipcall/bootstrap.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# configure zipcall +if ! [[ -z "${TWILIO_ACCOUNT_SID}" ]]; then + echo "TWILIO_ACCOUNT_SID=${TWILIO_ACCOUNT_SID} >> .env +fi +if ! [[ -z "${LOCAL_AUTH_TOKEN}" ]]; then + echo "LOCAL_AUTH_TOKEN=${LOCAL_AUTH_TOKEN} >> .env +fi + +npm start