Skip to content

Added Docker file #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use an official Golang image as a base# Use an official Golang image as a base
FROM golang:latest

# Set the working directory
WORKDIR /app

# Copy the local repository files to the Docker container
COPY . /app

# Copy the pre-generated certificates from the host
COPY configs/certs/key.pem /app/configs/certs/key.pem
COPY configs/certs/cert.pem /app/configs/certs/cert.pem

# Run the Go server
CMD ["go", "run", "cmd/server/main.go"]

# Expose the port
EXPOSE 8086
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ brew install golang
go run cmd/server/main.go
```

- Run with Docker

```bash
docker build -t flutter-webrtc-server .
docker run -d --name flutter-webrtc-server-container -p 8086:8086 flutter-webrtc-server
```

- Open https://0.0.0.0:8086 to use flutter web demo.
- If you need to test mobile app, please check the [webrtc-flutter-demo](https://github.com/cloudwebrtc/flutter-webrtc-demo).

Expand Down