feat: Add Docker setup and integrate a local CoTURN server for WebRTC ICE candidates.

This commit is contained in:
2026-02-23 02:58:12 +01:00
parent 5475fe4fc3
commit aff93a5b4f
4 changed files with 40 additions and 2 deletions

7
Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

21
docker-compose.yml Normal file
View File

@@ -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

View File

@@ -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"
}
]
};

View File

@@ -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"
}
]
};