From 5f5876b0229b5bcbb2dc9286e814e6e3e5a24ef8 Mon Sep 17 00:00:00 2001 From: Umanda Jayobandara Date: Mon, 17 Jun 2024 20:25:30 +0530 Subject: [PATCH 1/2] Added Docker file --- Dockerfile | 18 ++++++++++++++++++ README.md | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..42fd9b35 --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index b2f769aa..f217a5bd 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,14 @@ brew install golang go run cmd/server/main.go ``` +- Run with Docker + +```bash +docker build -t flutter-webrtc-server . +go run cmd/server/main.go +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). From 42988865d6d8256eb5e2a0b4c6e1f41c7aa7e6df Mon Sep 17 00:00:00 2001 From: Umanda Jayobandara Date: Mon, 17 Jun 2024 20:27:47 +0530 Subject: [PATCH 2/2] Update README.md typo fix --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f217a5bd..90006f43 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ go run cmd/server/main.go ```bash docker build -t flutter-webrtc-server . -go run cmd/server/main.go docker run -d --name flutter-webrtc-server-container -p 8086:8086 flutter-webrtc-server ```