feat: Add Docker setup and integrate a local CoTURN server for WebRTC ICE candidates.
This commit is contained in:
7
Dockerfile
Normal file
7
Dockerfile
Normal 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
21
docker-compose.yml
Normal 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
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user