From 01a3ec367eba5095e442bc716bb5df041ef7abe7 Mon Sep 17 00:00:00 2001 From: starP-W <812978083@qq.com> Date: Sat, 6 Jul 2019 01:23:29 +0800 Subject: [PATCH] Added dockerfile with blivechat v1.1.2 --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3736ce6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:bionic + +COPY . ./blivechat + +RUN apt update && apt install python3 wget git curl tar python3-distutils -y + +RUN wget -q https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz && \ +tar xf node-v10.16.0-linux-x64.tar.xz && \ +ln -s /node-v10.16.0-linux-x64/bin/node /usr/bin/node && \ +ln -s /node-v10.16.0-linux-x64/bin/npm /usr/bin/npm + +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py + +RUN cd /blivechat/ && \ +pip install -r requirements.txt && \ +git reset --hard 2d86449 && \ +git clone https://github.com/xfgryujk/blivedm.git && \ +cd blivedm && git reset --hard 003d89e + + +RUN cd /blivechat/frontend && npm i && npm run build + +CMD /usr/bin/python3 /blivechat/main.py --host 0.0.0.0 --port 80 +EXPOSE 80/tcp +EXPOSE 80/udp diff --git a/README.md b/README.md index d940624..304436a 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,18 @@ 3. 用浏览器打开[http://localhost](http://localhost),输入房间ID,进入房间,复制房间URL 4. (可选)用样式生成器生成样式,复制CSS 5. 在OBS中添加浏览器源,输入URL和自定义CSS,或者可以在首页的样式设置里输入CSS + +### 使用Docker运行(仅x64) +1. 安装[docker](https://www.runoob.com/docker/ubuntu-docker-install.html) +2. 安装镜像 + + `docker build -t blivechat:latest .` + +3. 运行镜像 + + `docker run -d --name blivechat -p 80:80 blivechat` + + 其中80:80的第一个80为映射到主机的端口号,可替换为其它端口。 +3. 用浏览器打开[http://localhost](http://localhost),输入房间ID,进入房间,复制房间URL +4. (可选)用样式生成器生成样式,复制CSS +5. 在OBS中添加浏览器源,输入URL和自定义CSS,或者可以在首页的样式设置里输入CSS