From ccc5a8240e4dbb1e8f832d8fabfd916d539b4bf3 Mon Sep 17 00:00:00 2001 From: "Axel Becerril (sk)" Date: Sat, 22 May 2021 18:56:24 -0500 Subject: [PATCH] add docker config --- Dockerfile | 9 +++++++++ README.md | 23 +++++++++++++++++++++++ docker-compose.yml | 9 +++++++++ 3 files changed, 41 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5e173c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:14 + +WORKDIR /usr/src/app + +COPY . . + +RUN npm install + +CMD ["node", "server.js"] diff --git a/README.md b/README.md index 5b1904f..e81318b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,29 @@ You can open the overlay in a regular web browser by visiting `http://localhost: Always use OBS as the final reference for how things will look during a stream! +## Using Docker Compose + +To use the Docker images configured with compose, you need [docker-compose](https://docs.docker.com/compose/install/). Once it's up a running, you simply do + +``` +docker-compose up --detach +``` + +To stop the server + +``` +docker-compose down +``` + +The config maps container's `8080` port to `localhost:8080`. If you need to use another localhost port, you need to change it in `docker-compose.yml` under the `ports` section. For example, to use the port `3000` you need to set the section as: + +```yaml + ports: + - "3000:8080" +``` + +The port number after the colon would be the port configured in `config.json`. + ## Adding the browser source in OBS 1. In an OBS Scene, add a new 'Browser' Source. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..54e8e40 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" + +services: + app: + build: . + ports: + - "8080:8080" + volumes: + - ./:/usr/src/app