Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
Fixed docker-compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Jun 20, 2021
1 parent 3e0a090 commit e99cfea
Show file tree
Hide file tree
Showing 14 changed files with 386 additions and 29 deletions.
13 changes: 3 additions & 10 deletions configs/docker/biz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ level = "info"
[nats]
url = "nats://nats:4222"

[signal.grpc]
#listen ip port
host = "0.0.0.0"
port = "5551"
allow_all_origins = true
# cert= "configs/certs/cert.pem"
# key= "configs/certs/key.pem"

[avp]
elements = ["webmsaver"]
[node]
# node id
nid = "biz01"
6 changes: 5 additions & 1 deletion configs/docker/islb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ level = "info"
[nats]
url = "nats://nats:4222"

[node]
# node id
nid = "islb01"

[redis]
addrs = ["redis:6379"]
password = ""
db = 0
db = 0
24 changes: 19 additions & 5 deletions configs/docker/sfu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dc = "dc1"
[nats]
url = "nats://nats:4222"

[node]
# node id
nid = "sfu01"

[sfu]
# Ballast size in MiB, will allocate memory to reduce the GC trigger upto 2x the
# size of ballast. Be aware that the ballast should be less than the half of memory
Expand Down Expand Up @@ -43,9 +47,12 @@ bestqualityfirst = true
enabletemporallayer = false

[webrtc]
# Single port, portrange will not work if you enable this
singleport = 5000

# Range of ports that ion accepts WebRTC traffic on
# Format: [min, max] and max - min >= 100
portrange = [15000, 15200]
# portrange = [5000, 5200]
# if sfu behind nat, set iceserver
# [[webrtc.iceserver]]
# urls = ["stun:stun.stunprotocol.org:3478"]
Expand All @@ -72,8 +79,16 @@ mdns = true
# Multiple public IP addresses can be specified as a comma separated list
# if the sfu is deployed in a DMZ between two 1-1 NAT for internal and
# external users.
nat1to1 = ["127.0.0.1"]
icelite = true
# nat1to1 = ["1.2.3.4"]
# icelite = true

[webrtc.timeouts]
# The duration in [sec] without network activity before a ICE Agent is considered disconnected
disconnected = 5
# The duration in [sec] without network activity before a ICE Agent is considered failed after disconnected
failed = 25
# How often in [sec] the ICE Agent sends extra traffic if there is no activity, if media is flowing no traffic will be sent
keepalive = 2

[turn]
# Enables embeded turn server
Expand All @@ -98,5 +113,4 @@ credentials = "pion=ion,pion2=ion2"

[log]
# 0 - INFO 1 - DEBUG 2 - TRACE
v = 1
level = "info"
v = 1
31 changes: 31 additions & 0 deletions configs/docker/sig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[global]
pprof = ":6064"
# data center id
dc = "dc1"

[log]
level = "info"
# level = "debug"

[nats]
url = "nats://nats:4222"

[node]
# node id
nid = "sig01"

[signal.grpc]
#listen ip port
host = "0.0.0.0"
port = "5551"
allow_all_origins = true
# cert= "configs/certs/cert.pem"
# key= "configs/certs/key.pem"

[signal.jwt]
enabled = false
key_type = "HMAC" # this selects the Signing method https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethod
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.svc]
services = ["sfu","biz","avp"]
16 changes: 13 additions & 3 deletions configs/sfu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ bestqualityfirst = true
enabletemporallayer = false

[webrtc]
# Single port, portrange will not work if you enable this
singleport = 5000

# Range of ports that ion accepts WebRTC traffic on
# Format: [min, max] and max - min >= 100
portrange = [10000, 50000]
#portrange = [5000, 5200]
# if sfu behind nat, set iceserver
# [[webrtc.iceserver]]
# urls = ["stun:stun.stunprotocol.org:3478"]
Expand Down Expand Up @@ -79,6 +82,14 @@ mdns = true
# nat1to1 = ["1.2.3.4"]
# icelite = true

[webrtc.timeouts]
# The duration in [sec] without network activity before a ICE Agent is considered disconnected
disconnected = 5
# The duration in [sec] without network activity before a ICE Agent is considered failed after disconnected
failed = 25
# How often in [sec] the ICE Agent sends extra traffic if there is no activity, if media is flowing no traffic will be sent
keepalive = 2

[turn]
# Enables embeded turn server
enabled = false
Expand All @@ -102,5 +113,4 @@ credentials = "pion=ion,pion2=ion2"

[log]
# 0 - INFO 1 - DEBUG 2 - TRACE
v = 1
level = "info"
v = 1
2 changes: 1 addition & 1 deletion configs/sig.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[global]
pprof = ":6060"
pprof = ":6064"
# data center id
dc = "dc1"

Expand Down
19 changes: 16 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
volumes:
- "./configs/docker/sfu.toml:/configs/sfu.toml"
ports:
- "15000-15200:15000-15200/udp"
- "5000:5000/udp"
- 3478:3478
depends_on:
- nats
Expand All @@ -44,15 +44,28 @@ services:
networks:
- ionnet

sig:
image: pionwebrtc/ion:latest-sig
build:
dockerfile: ./docker/sig.Dockerfile
context: .
volumes:
- "./configs/docker/sig.toml:/configs/sig.toml"
ports:
- 5551:5551
depends_on:
- islb
- biz
networks:
- ionnet

biz:
image: pionwebrtc/ion:latest-biz
build:
dockerfile: ./docker/biz.Dockerfile
context: .
volumes:
- "./configs/docker/biz.toml:/configs/biz.toml"
ports:
- 5551:5551
depends_on:
- nats
- islb
Expand Down
1 change: 1 addition & 0 deletions docker/avp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN cd $GOPATH/src/github.com/pion/ion && go mod download

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/avp
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /avp .
Expand Down
5 changes: 3 additions & 2 deletions docker/biz.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto
COPY apps/ $GOPATH/src/github.com/pion/ion/apps

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/biz
WORKDIR $GOPATH/src/github.com/pion/ion/apps/biz
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /biz .

FROM alpine:3.12.1
Expand Down
1 change: 1 addition & 0 deletions docker/islb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN cd $GOPATH/src/github.com/pion/ion && go mod download

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/islb
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /islb .
Expand Down
1 change: 1 addition & 0 deletions docker/sfu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN cd $GOPATH/src/github.com/pion/ion && go mod download

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/sfu
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /sfu .
Expand Down
25 changes: 25 additions & 0 deletions docker/sig.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.14.13-stretch

ENV GO111MODULE=on

WORKDIR $GOPATH/src/github.com/pion/ion

COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/signal
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /sig .

FROM alpine:3.12.1

RUN apk --no-cache add ca-certificates
COPY --from=0 /sig /usr/local/bin/sig

COPY configs/docker/sig.toml /configs/sig.toml

ENTRYPOINT ["/usr/local/bin/sig"]
CMD ["-c", "/configs/sig.toml"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/nats-io/nats.go v1.10.0
github.com/pion/ion-avp v1.8.4
github.com/pion/ion-log v1.2.0
github.com/pion/ion-sfu v1.9.9
github.com/pion/ion-sfu v1.10.6
github.com/pion/webrtc/v3 v3.0.29
github.com/pixelbender/go-sdp v1.1.0
github.com/soheilhy/cmux v0.1.4
Expand Down
Loading

0 comments on commit e99cfea

Please sign in to comment.