Skip to content

Commit

Permalink
Add docker-compose to pion-to-pion example
Browse files Browse the repository at this point in the history
Docker-compose allows people to run the example faster.

Resolves #192
  • Loading branch information
Hixon10 authored and Sean-Der committed Oct 1, 2018
1 parent 64ea3a3 commit 3afe43c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Check out the **[contributing wiki](https://github.com/pions/webrtc/wiki/Contrib
* [Max Hawkins](https://github.com/maxhawkins) - *RTCP*
* [Justin Okamoto](https://github.com/justinokamoto) - *Fix Docs*
* [leeoxiang](https://github.com/notedit) - *Implement Janus examples*
* [Denis](https://github.com/Hixon10) - *Adding docker-compose to pion-to-pion example*

### License
MIT License - see [LICENSE.md](LICENSE.md) for full text
9 changes: 8 additions & 1 deletion examples/pion-to-pion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ go install github.com/pions/webrtc/examples/pion-to-pion/offer
offer
```

You should see them connect and start to exchange messages.
You should see them connect and start to exchange messages.

## You can use Docker-compose to start this example:
```sh
docker-compose up -d
```

Now, you can see message exchanging, using `docker logs`.
15 changes: 15 additions & 0 deletions examples/pion-to-pion/answer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.11

COPY . /go/src/pion-to-pion/answer
WORKDIR /go/src/pion-to-pion

RUN apt-get update && apt-get install -y \
libssl-dev

RUN go get -u github.com/pions/webrtc

RUN go install -v ./...

CMD ["answer"]

EXPOSE 50000
19 changes: 19 additions & 0 deletions examples/pion-to-pion/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
answer:
container_name: answer
build: ./answer
hostname: answer
restart: always
ports:
- 50000:50000
network_mode: "host"

offer:
depends_on:
- answer
container_name: offer
build: ./offer
hostname: offer
restart: always
network_mode: "host"
13 changes: 13 additions & 0 deletions examples/pion-to-pion/offer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.11

COPY . /go/src/pion-to-pion/offer
WORKDIR /go/src/pion-to-pion

RUN apt-get update && apt-get install -y \
libssl-dev

RUN go get -u github.com/pions/webrtc

RUN go install -v ./...

CMD ["offer"]

0 comments on commit 3afe43c

Please sign in to comment.