From aff93a5b4fdc637d03a60341f335c97dd4b37a36 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Mon, 23 Feb 2026 02:58:12 +0100 Subject: [PATCH] feat: Add Docker setup and integrate a local CoTURN server for WebRTC ICE candidates. --- Dockerfile | 7 +++++++ docker-compose.yml | 21 +++++++++++++++++++++ public/app.js | 7 ++++++- public/viewer.js | 7 ++++++- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ce93959 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:20-alpine +WORKDIR /app +COPY package*.json ./ +RUN npm install --production +COPY . . +EXPOSE 3000 +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3d079cd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3.8" + +services: + app: + build: . + ports: + - "3000:3000" + restart: always + + coturn: + image: coturn/coturn:latest + network_mode: "host" + restart: always + command: > + -n + --log-file=stdout + --min-port=49152 + --max-port=49252 + --realm=yourdomain.com + --user=myuser:mypassword + --stale-nonce diff --git a/public/app.js b/public/app.js index 65d747a..3c6351b 100644 --- a/public/app.js +++ b/public/app.js @@ -9,7 +9,12 @@ let activeStream; const config = { iceServers: [ - { urls: "stun:stun.l.google.com:19302" } + { urls: "stun:localhost:3478" }, + { + urls: "turn:localhost:3478", + username: "myuser", + credential: "mypassword" + } ] }; diff --git a/public/viewer.js b/public/viewer.js index 32c1155..ddd6d8a 100644 --- a/public/viewer.js +++ b/public/viewer.js @@ -5,7 +5,12 @@ const overlay = document.getElementById('overlay'); let peerConnection; const config = { iceServers: [ - { urls: "stun:stun.l.google.com:19302" } + { urls: "stun:localhost:3478" }, + { + urls: "turn:localhost:3478", + username: "myuser", + credential: "mypassword" + } ] };